NMath User's Guide

TOC | Previous | Next | Index

49.2 Significance of Parameters (.NET, C#, CSharp, VB, Visual Basic, F#)

Instances of class GoodnessOfFitParameter test statistical hypothesis about individual parameters in a least squares model-fit.

Creating Goodness of Fit Parameter Objects

You can get an array of test objects for all parameters in a GoodnessOfFit using the Parameters property:

Code Example – C# goodness of fit

GoodnessOfFitParameter[] params = gof.Parameters;

Code Example – VB goodness of fit

Dim Params() As GoodnessOfFitParameter = gof.Parameters

Properties of Goodness of Fit Parameters

Class GoodnessOfFitParameter provides the following properties:

Index gets the index of the parameter in the overall model.

Value gets the value of the parameter.

StandardError gets the standard error of the parameter.

DegreesOfFreedom gets the degrees of freedom of the parameter.

Hypothesis Tests

Class GoodnessOfFitParameter provides the following methods for testing statistical hypotheses regarding parameter values:

TStatisticPValue() returns the p-value for a two-sided t test with the null hypothesis that the parameter is equal to a given test value, versus the alternative hypothesis that it is not.

TStatistic() returns the value of the t statistic for the null hypothesis that the parameter value is equal to a given test value.

TStatisticCriticalValue() gets the critical value for the t-statistic for a given alpha level.

ConfidenceInterval() returns a confidence interval for the parameter for a given alpha level.

For example, this code tests whether a parameter in a model is significantly different than zero:

Code Example – C# goodness of fit

double tstat = param.TStatistic( 0.0 );
double pValue = param.TStatisticPValue( 0.0 );
double criticalValue = param.TStatisticCriticalValue( 0.05 );
Interval confidenceInterval = param.ConfidenceInterval( 0.05 );

Code Example – VB goodness of fit

Dim TStat As Double = param.TStatistic(0.0)
Dim PValue As Double = param.TStatisticPValue(0.0)
Dim CriticalValue As Double = param.TStatisticCriticalValue(0.05)
Dim ConfidenceInterval As Interval = param.ConfidenceInterval(0.05)


Top

Top