computechi2¶
-
class
pydl.pydlutils.math.computechi2(bvec, sqivar, amatrix)[source]¶ Bases:
objectSolve 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.ndarrayThe \(b\) vector in \(A x = b\). This vector has length \(N\).
sqivar :
numpy.ndarrayThe reciprocal of the errors in
bvec. The name comes from the square root of the inverse variance, which is what this is.amatrix :
numpy.ndarrayThe 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
-
acoeff¶ (
ndarray) The fit parameters, \(x\), in \(A x = b\). This vector has length \(M\).
-
chi2¶ (
float) The \(\chi^2\) value of the fit.
-
covar¶ (
ndarray) The covariance matrix. The shape of this matrix is (\(M\), \(M\)).
-
dof¶ (
int) The degrees of freedom of the fit. This is the number of values ofbvecthat havesqivar> 0 minus the number of fit paramaters, which is equal to \(M\).
-
var¶ (
ndarray) The variances of the fit. This is identical to the diagonal of the covariance matrix. This vector has length \(M\).
-
yfit¶ (
ndarray) The evaluated best-fit at each point. This vector has length \(N\).
-