ocmath_confidence_levels_for_variance

 

Description

Function to compute confidence levels for a variance.

Syntax

int ocmath_confidence_levels_for_variance( UINT nLevels, const double * pLevels, const double dSD, const double dDOF, double * pLCLs, double * pUCLs )

Parameters

nLevels
[input] number of levels in pLevels.
pLevels
[input] pointer to confidence levels, e.g. {0.9, 0.95, 0.99}
dSD
[input] value of SD of input data for variance test
dDOF
[input] DOF of input data for variance test
pLCLs
[Output] pointers to Lower Confidence Limits for variance
pUCLs
[Output] pointers to Upper Confidence Limits for variance

Return

Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.

Examples

EX1

void ocmath_confidence_levels_for_variance_ex1()
{
    vector vLevels = {0.9, 0.95, 0.99};
    UINT nLevels = vLevels.GetSize();
    double SD = 0.1, DOF = 3.0;
    vector vLCLs, vUCLs;
    vLCLs.SetSize(nLevels);
    vUCLs.SetSize(nLevels);

    int nRet = ocmath_confidence_levels_for_variance(nLevels, vLevels, SD, DOF, vLCLs, vUCLs);
    out_int("nRet=", nRet); //nRet = 0;
    int ii;
    
    //print out Lower Confidence Limits for variance
    printf("vLCLs = {");
    for(ii=0; ii<vLCLs.GetSize(); ii++)
    {
        printf("%f\t", vLCLs[ii]);
    }
    printf("}\n");
    
    //print out Upper Confidence Limits for variance
    printf("vUCLs = {");
    for(ii=0; ii<vUCLs.GetSize(); ii++)
    {
        printf("%f\t", vUCLs[ii]);
    }
    printf("}\n");
}

Remark

See Also

Header to Included

origin.h

Reference