From: Donald on
Hello,

I'm playing around with the grpstats function and noticed that there is a function predci for the '95% prediction interval for a new observation'. Does anyone know the formula or inner-workings of this function? I've not seen a prediction interval before. Thanks!


peace
d
From: us on
"Donald " <donald.frederick(a)gmail.com> wrote in message <herm9n$nsq$1(a)fred.mathworks.com>...
> Hello,
>
> I'm playing around with the grpstats function and noticed that there is a function predci for the '95% prediction interval for a new observation'. Does anyone know the formula or inner-workings of this function? I've not seen a prediction interval before. Thanks!
>
>
> peace
> d

a hint:
- note: based on ML ver 2009b

1) edit GRPSTATS
2) drill down to line #372
3) look at the (nested) funcition PREDCI (#372-378)

function ci = predci(y,m,s,n,d) % m,s,n,d are local variables
n = size(y,1);
m = mean(y,1);
s = std(y,0,1) * sqrt(1 + 1/n);
d = s * -tinv(alpha/2, max(0,n-1));
ci = [m-d; m+d];
end

us