computechi2¶
-
class
pydl.pydlutils.math.
computechi2
(bvec, sqivar, amatrix)[source]¶ Bases:
object
Solve the linear set of equations \(A x = b\) using SVD.
The attributes of this class are all read-only properties, implemented with
lazyproperty
.Parameters: - bvec :
numpy.ndarray
The \(b\) vector in \(A x = b\). This vector has length \(N\).
- sqivar :
numpy.ndarray
The reciprocal of the errors in
bvec
. The name comes from the square root of the inverse variance, which is what this is.- amatrix :
numpy.ndarray
The matrix \(A\) in \(A x = b\). The shape of this matrix is (\(N\), \(M\)).
Initialize the object and perform initial computations.
Attributes Summary
acoeff
( ndarray
) The fit parameters, \(x\), in \(A x = b\).chi2
( float
) The \(\chi^2\) value of the fit.covar
( ndarray
) The covariance matrix.dof
( int
) The degrees of freedom of the fit.var
( ndarray
) The variances of the fit.yfit
( ndarray
) The evaluated best-fit at each point.Attributes Documentation
-
dof
¶ (
int
) The degrees of freedom of the fit. This is the number of values ofbvec
that havesqivar
> 0 minus the number of fit paramaters, which is equal to \(M\).
- bvec :