Cosmetic changes only.
This commit is contained in:
parent
4051549b27
commit
2d7bc36fee
@ -9,20 +9,20 @@ function [LoadingRate, StandardError, ConfidenceInterval] = bootstrapErrorEstima
|
|||||||
if ~isnan(CorrelationFactor)
|
if ~isnan(CorrelationFactor)
|
||||||
SampleLength = floor(CorrelationFactor);
|
SampleLength = floor(CorrelationFactor);
|
||||||
NumberOfBootsrapSamples = 1000;
|
NumberOfBootsrapSamples = 1000;
|
||||||
MeanLoadingRatioInEachSample = zeros(1,NumberOfBootsrapSamples);
|
MeanCaptureRatioInEachSample = zeros(1,NumberOfBootsrapSamples);
|
||||||
for SampleNumber = 1:NumberOfBootsrapSamples
|
for SampleNumber = 1:NumberOfBootsrapSamples
|
||||||
BoostrapSample = datasample(NumberOfLoadedAtoms, SampleLength); % Sample with replacement
|
BoostrapSample = datasample(NumberOfLoadedAtoms, SampleLength); % Sample with replacement
|
||||||
MeanLoadingRatioInEachSample(SampleNumber) = mean(BoostrapSample) / n; % Empirical bootstrap distribution of sample means
|
MeanCaptureRatioInEachSample(SampleNumber) = mean(BoostrapSample) / n; % Empirical bootstrap distribution of sample means
|
||||||
end
|
end
|
||||||
|
|
||||||
LoadingRate = mean(MeanLoadingRatioInEachSample) * ovenObj.ReducedFlux;
|
LoadingRate = mean(MeanCaptureRatioInEachSample) * ovenObj.ReducedFlux;
|
||||||
|
|
||||||
Variance = 0; % Bootstrap Estimate of Variance
|
Variance = 0; % Bootstrap Estimate of Variance
|
||||||
for SampleNumber = 1:NumberOfBootsrapSamples
|
for SampleNumber = 1:NumberOfBootsrapSamples
|
||||||
Variance = Variance + (MeanLoadingRatioInEachSample(SampleNumber) - mean(MeanLoadingRatioInEachSample))^2;
|
Variance = Variance + (MeanCaptureRatioInEachSample(SampleNumber) - mean(MeanCaptureRatioInEachSample))^2;
|
||||||
end
|
end
|
||||||
|
|
||||||
StandardError = sqrt((1 / (NumberOfBootsrapSamples-1)) * Variance) * ovenObj.ReducedFlux;
|
StandardError = sqrt((1 / (NumberOfBootsrapSamples-1)) * Variance) * ovenObj.ReducedFlux;
|
||||||
|
|
||||||
ts = tinv([0.025 0.975],NumberOfBootsrapSamples-1); % T-Score
|
ts = tinv([0.025 0.975],NumberOfBootsrapSamples-1); % T-Score
|
||||||
ConfidenceInterval = LoadingRate + ts*StandardError; % 95% Confidence Intervals
|
ConfidenceInterval = LoadingRate + ts*StandardError; % 95% Confidence Intervals
|
||||||
|
Loading…
Reference in New Issue
Block a user