Package reflectometry :: Package reduction :: Module wsolve :: Class PolynomialModel

Class PolynomialModel

source code


Model evaluator for best fit polynomial p(x) = y.

Stored properties:

DoF = len(y)-len(x) = degrees of freedom
rnorm = 2-norm of the residuals y-Ax
coeff = coefficients
degree = polynomial degree

Computed properties:

cov = covariance matrix [ inv(A'A); O(n^3) ]
var = coefficient variance [ diag(cov); O(n^2)]
std = standard deviation of coefficients [ sqrt(var); O(n^2) ]
p = test statistic for chisquare goodness of fit [ chi2.sf; O(1) ]

Methods:

__call__(x): return the polynomial evaluated at x
ci(x,sigma=1):  return confidence interval evaluated at x
pi(x,alpha=0.05):  return prediction interval evaluated at x

Note that the covariance matrix will not include the ones column if the polynomial goes through the origin.

Instance Methods
 
__init__(self, s, origin=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, x)
Evaluate the polynomial at x.
source code
 
ci(self, x, sigma=1)
Evaluate the polynomial and the confidence intervals at x.
source code
 
pi(self, x, p=0.05)
Evaluate the polynomial and the prediction intervals at x.
source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties
  cov
covariance matrix
  var
result variance
  std
result standard deviation
  p
probability of rejection

Inherited from object: __class__

Method Details

__init__(self, s, origin=False)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

ci(self, x, sigma=1)

source code 

Evaluate the polynomial and the confidence intervals at x.

sigma=1 corresponds to a 1-sigma confidence interval

pi(self, x, p=0.05)

source code 

Evaluate the polynomial and the prediction intervals at x.

p = 1-alpha = 0.05 corresponds to 95% prediction interval

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

Property Details

cov

covariance matrix
Get Method:
_cov(self)

var

result variance
Get Method:
_var(self)

std

result standard deviation
Get Method:
_std(self)

p

probability of rejection
Get Method:
_p(self)