??? Error using ==> jackknife
Too many input arguments.
Error in ==> bootci>bootbca at 216
jstat = jackknife(bootfun,varargin{:});
Error in ==> bootci at 127
ci = bootbca(nboot,fun,alpha,data{:});
even when I try something very simple such as:
data=[1 2 3 4 5 6 7 8 9 10];
ci = bootci(100,@mean,data);
I am sure that I have previously used this function without problems in an earlier version of Matlab. I am currently running version 7.8.0.347 (R2009a). I tried using a different type of bootci. eg
ci = bootci(100,@mean,data,'type','cper') but then received a different error message (maybe I am not specifying the type correctly?):
??? Error using ==> bootci at 106
Error evaluating BOOTFUN function 'mean'.
Caused by:
Error using ==> mean
Too many input arguments.
Thanks for any help,
Ruth
Ruth,
the code above works for me.
You are sure you did not overwrite function mean?
Regards Han
I'm getting the same problem as Ruth:
-----------------------------------------------
>> mean(rand(10,1))
ans =
0.4233
>> bootci(2000,@mean,rand(10,1))
??? Error using ==> jackknife
Too many input arguments.
Error in ==> bootci>bootbca at 260
jstat = jackknife(bootfun,varargin{:},'Options',bootstrpOptions);
Error in ==> bootci at 170
[ci,bootstat] = bootbca(obsstat,nboot,fun,alpha,weights,bootstrpOptions,data{:});
-----------------------------------------------
I'm running R2010b on a 64-bit intel mac with Snow Leopard.
The function 'mean' is not overridden. The same thing happens using 'median', 'std', 'var', and so forth.
This looks very much like a Mathworks bug.
Regards,
Jack
The trick here is to separate the arguments to bootci from the arguments
intended to be passed along to mean. Try this:
ci = bootci(100, {@mean,data}, 'type','cper')
Note that I've grouped the mean function with its arguments by enclosing
them together in a cell array.
>>> bootci(2000,@mean,rand(10,1))
> ??? Error using ==> jackknife
> Too many input arguments.
This one I am unable to reproduce. It appears to be claiming that you've
passed more arguments to jackknife than it is declared to handle. But it
should be declared to handle a variable number. Would you mind trying this?
>> dbtype jackknife 1
1 function jackstat = jackknife(jackfun,varargin)
>> which jackknife
...\matlab\toolbox\stats\stats\jackknife.m
This shows that I'm invoking the Statistics Toolbox jackknife function, and
it is defined to accept a variable number of inputs.
-- Tom
> ci = bootci(100, {@mean,data}, 'type','cper')
Yes, thanks, this now works for me.
> >>> bootci(2000,@mean,rand(10,1))
> > ??? Error using ==> jackknife
> > Too many input arguments.
> >> dbtype jackknife 1
>
> 1 function jackstat = jackknife(jackfun,varargin)
>
> >> which jackknife
> ...\matlab\toolbox\stats\stats\jackknife.m
I tried the above and found that I was calling a different jackknife function (from the Chronux spectral analysis toolbox I downloaded recently). I renamed that function and now >> bootci(2000,@mean,rand(10,1)) works just fine.
Sorry for not being able to solve this problem myself (doh!) and thanks again for the prompt help.
Ruth