SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Models an estimated linear regression parameter using a T distribution. More...
#include <rw/analytics/linregparam.h>
Public Member Functions | |
RWLinearRegressionParam () | |
RWLinearRegressionParam (const RWLinearRegressionParam &p) | |
RWLinearRegressionParam (double val, double err, int degrees) | |
RWInterval< double > | confidenceInterval (double alpha) const |
RWLinearRegressionParam & | operator= (const RWLinearRegressionParam &p) |
double | standardError () const |
double | tStatistic (double testval=0.0) const |
double | tStatisticCriticalValue (double alpha) const |
double | tStatisticPValue (double testval=0.0) const |
double | value () const |
Class RWLinearRegressionParam models an estimated linear regression parameter using a T distribution. Once a class instance is constructed, it can be used to test some statistical hypothesis about the parameter's value.
The following simple example prints the 99 percent confidence intervals for all parameters in a linear regression.
|
inline |
Constructs an empty linear regression parameter object. Behavior undefined.
|
inline |
Constructs a copy of p.
|
inline |
Constructs a Student T distribution for a linear regression parameter that has mean val, standard deviation err, and degrees of freedom equal to degrees.
RWInterval<double> RWLinearRegressionParam::confidenceInterval | ( | double | alpha | ) | const |
Returns an alpha level confidence interval for the parameter.
RWLinearRegressionParam& RWLinearRegressionParam::operator= | ( | const RWLinearRegressionParam & | p | ) |
Copies the contents of p to self.
|
inline |
Returns the estimated standard error for the estimate. The estimate for the pth parameter of a linear regression is defined by the equation:
\[ \hat{\sigma}_p = \sqrt{S^2\{(\mathbf{X'X})^{-1}\}_{pp}} \]
where:
\[ S^2 = \cfrac{(\mathbf{Y-X}\hat{\beta})'(\mathbf{Y-X}\hat{\beta})} {n-p} \]
\(\{(\mathbf{X'X})^{-1}\}_{pp}\) is equal to the pth diagonal term of the matrix \((\mathbf{X'X})^{-1}\) and n is the number of observations.
|
inline |
Returns the t-test for the hypothesis that the parameter is equal to testval.
|
inline |
Returns the absolute value for which the parameter would have to differ from testval
before we would reject the hypothesis that the parameter is equal to testval
at significance level alpha.
double RWLinearRegressionParam::tStatisticPValue | ( | double | testval = 0.0 | ) | const |
Returns the P-value for the parameter t statistic under the hypothesis that the parameter is equal to testval.
|
inline |
Returns the least squares estimate for the parameter.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |