일부 신뢰 구간 계산을 테스트 중이지만 수동 계산에서 Matlab 함수 normfit/fitdist/paramci
을 사용하여 차이점을 발견했습니다. 아래 코드를 살펴보고 더 많은 요소가 포함 된 data
을 테스트하십시오. 데이터 크기가 커질수록 차이가 더 작아집니다. 누군가가 단서/해결책/설명을 가지고 있습니까?normlit/fitdist/paramci를 사용하는 Matlab Confidence Interval은 요소 수에 따라 수동 계산과 다릅니다. 왜?
감사
윌
%% Cleaning service
clear all; close all;
%% Data and processing
conf = norminv([0.025 0.975],0,1); % for 95%
data = normrnd(0.158,0.0265,10,1); % Change the third argument to 100, 1000, 1000, ...
[mu,sigma,muci,sigmaci] = normfit(data,.05); % for 95%
pd = fitdist(data,'Normal'); ci = paramci(pd,'Alpha',.05); % for 95%
xplus = mu + conf(2)*sigma*(1/sqrt(length(data)));
xminus = mu - conf(2)*sigma*(1/sqrt(length(data)));
Difference = [ci(1,1)-xminus ci(2,1)-xplus]