<< conint_normmunumber Conint

Conint >> Conint > conint_normvar

conint_normvar

C.I. of the variance of a normal variable.

Calling Sequence

[ low, up ] = conint_normvar ( n , v )
[ low, up ] = conint_normvar ( n , v , level )
[ low, up ] = conint_normvar ( n , v , level , twosided )

Parameters

n :

a 1-by-1 matrix of doubles, positive, integer value, the number of samples

v :

a 1-by-1 matrix of doubles, positive, the variance estimate

level :

a 1-by-1 matrix of doubles, the confidence level (default level = 1.-0.95=0.05). level is expected to be in the range [0.,0.5]

twosided :

a 1-by-1 matrix of booleans, the side of the interval (default twosided = %t). If twosided is true, then low and up is a two-sided interval [low,up]. If twosided is false, then the intervals are [-inf,up] and [low,inf].

low :

a 1-by-1 matrix of doubles, the estimated lower bound

up :

a 1-by-1 matrix of doubles, the estimated upper bound

Description

Computes a confidence interval of the variance of a normal variable, that is, computes v as the variance of x and computes confidence intervals for v.

If twosided is true, then low and up are such that the variance var(X) is such that

P(low < var < up) = 1-level

If twosided is false, then low and up are such that the variance var(X) is such that

P(var(X) < up) = 1-level

and

P(low < var(X)) = 1-level

This function makes the assumption that the data in x has a normal distribution with expectation mu(X) and variance var(X).

We use a Chi-square distribution to compute the confidence interval.

Examples

// Sheldon Ross, Example 7.3h, page 252
// Compute a 90% confidence interval for the
// variance of a normal variable.
x = [0.123 0.124 0.126 0.120 0.130 ...
0.133 0.125 0.128 0.124 0.126]
n = size(x,"*")
v = variance(x)
[ low, up ] = conint_normvar ( n , v , 1.-0.90 )
// Then P(7.264D-06 <= var(X) <= 36.96D-06) = 0.90
// Give the confidence interval for the standard
// deviation
[sqrt(low) sqrt(v) sqrt(up)]

// Example from Gilbert Saporta,
// Section 13.5.3, "Variance d'une loi normale"
// Section 13.5.3.2, "m est inconnu"
// Get the C.I. for the variance of a normal
// variable with n=30 and var(X)=12.
x = [6;2;2;8;12;6;6;13;..
8;2;10;0;7;5;4;4;3;..
7;4;9;6;2;-3;5;7;2;4;5;2;2];
n = size(x,"*")
v = variance(x)
[ low, up ] = conint_normvar ( n , v , 1.-0.90 )
// Then P(8.177 < var(X) < 19.65) = 0.90
// The 90% C.I. is (8.177,19.65)
// Notice that Saporta gets (8.46,20.33).
// This is because Saporta uses n as the denominator
// in the variance estimate, while we use (n-1).

// Example from
// "Probability and Statistics for Engineers and Scientists",
// Walpole, Myers, Myers, Ye
// Example 9.17:
x = [46.4, 46.1, 45.8, 47.0, 46.1, ..
45.9, 45.8, 46.9, 45.2, 46.0];
n = size(x,"*")
v = variance(x)
[ low, up ] = conint_normvar ( n , v , 1.-0.95 )
// Then (0.135,0.953) is a 95% C.I. for the variance.

Authors

Bibliography

http://en.wikipedia.org/wiki/Confidence_interval

"Introduction to probability and statistics for engineers and scientists", Sheldon Ross, Third Edition, 2004

"Probabilités, Analyse de Données et Statistique", Gilbert Saporta, 2nd Ed., 2006

// "Probability and Statistics for Engineers and Scientists", Ronald Walpole, Raymond Myers, Sharon Myers, Keying Ye, Eight Edition, 2006


Report an issue
<< conint_normmunumber Conint