Reproducible results using "bootci" matlab function
显示 更早的评论
Hello. I am trying to use matlab's "bootci" statistics toolbox function and I am having difficulty getting reproducible results. Basically each and every time I calculate the confidence interval I want it to be exactly the same. This is because I later calculate confidence intervals for other metrics and I want to make sure the same samples were used when the confidence interval was calculated for each one. I also have the parallel processing toolbox, but it is not necessary because the confidence interval estimation doesn't take very long.
Below is some example code using matlab's example with some of my modifications. Thanks for anyone's your help.
%% Use same example in Matlab bootci function with minor modifications
y = normrnd(1,1,30,1); % Simulated process data
LSL = -3; USL = 3; % Process specifications
capable = @(x)(USL-LSL)./(6* std(x)); % Process capability
%% Set up random number
s=RandStream('mlfg6331_64');
options=statset('UseSubstreams', true, 'Streams', s);
%% Compute the confidence interval and check to see if they are the same
ci1 = bootci(2000,{capable,y}, 'options', options)
ci2 = bootci(2000,{capable,y}, 'options', options)
isequal(ci1, ci2)%I want them to be exactly the same
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Resampling Techniques 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!