Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: bootstrp and bootci don't work if data inputs are not same length
Date: Sat, 7 Nov 2009 03:35:05 +0000 (UTC)
Organization: University of Vermont
Lines: 15
Message-ID: <hd2pt9$jnu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257564905 20222 172.30.248.37 (7 Nov 2009 03:35:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 7 Nov 2009 03:35:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 482243
Xref: news.mathworks.com comp.soft-sys.matlab:583175


Has anyone made a workaround for this issue?   bootstrp documentation does not constrain the input data to same size, but this error is thrown when passing in two vectors of different sizes (which should be fine, so long as the bootfun is designed to handle this):

??? Index exceeds matrix dimensions.

Error in ==> bootstrp at 114
      tmp = feval(bootfun,X1(onesample,:),X2(onesample,:));


Looking at bootstrp line 114, the cause is clear:

onesample (a set of n indices randomly generated over [1,n]) is generated once, and then used to index into all data vectors passed into bootstrp (ugh).  However, n is defined as the max length of all varargin, so indexing into the shorter data vector(s) will throw the error.

In case anyone is interested, the bootfun takes two vectors (each of whose elements contain only 1's and 0's), and computes a ratio of (sum1/length1) / (sum2/length2).

Thank you for the help!