MATLAB Answers

Single-non-singleton assignment error during Bootstrap

3 views (last 30 days)
Abhilash
Abhilash on 18 Jun 2012
Hi guys,
So I this data set, 8 points each, one for two different conditions, let's say Sound and No-sound. X-axis is contrast values and the data points are performance (% correct).
So I fit a hyperbolic ratio function to them and estimated three parameters. Now I want to run a bootstrap on them to estimate confidence intervals. I've tried high and low and it always returns this damn error -
??? Error using ==> bootci at 146
Error evaluating BOOTFUN function 'hlf_for_bootstrap'.
Error in ==> parallel_function at 479
consume(base, limit, F(base, limit, supply(base, limit)));
Caused by:
Assignment has more non-singleton rhs dimensions than non-singleton
subscripts
I have no idea why this is happening because I do the SAME thing to data from a different experiment (I just fit a different mode, everything else is the same) and it works perfectly fine.
Here are the routines I've written -
clear all
close all
clc
%%Load data
load dataSet.mat
%%Assign parameters
Params.nIter = 20;
Params.C = [0 4 6.5 9 13.5 18 23.5 30];
Params.G = [0 5];
Params.N = [0 7];
Params.C50 = [0 35];
Params.nboot = 2000;
%%Run bootstrap
fitbs = @hlf_for_bootstrap;
s = RandStream('mlfg6331_64','Seed',1);
options = statset('Streams',s,'UseSubstreams','always','UseParallel','always');
parfor j = 1:size(dataSet,1)
data = (dataSet(j,:))';
[ci{j},bootstat{j}] = bootci(Params.nboot,{fitbs,data,Params},'Options',options,'type','bca');
end
The function @hlf_for_bootstrap minimises the least squared error and returns to me the three parameters as - param_ests = [A B C] where A, B and C are values.
I'd be very grateful if someone could please help me out.
Thanks

  0 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!