Inheritance diagram for nipy.algorithms.statistics.models.glm:
Bases: nipy.algorithms.statistics.models.regression.WLSModel
Methods
cont([tol]) | Continue iterating, or has convergence been obtained? |
deviance([Y, results, scale]) | Return (unnormalized) log-likelihood for GLM. |
estimate_scale([Y, results]) | Return Pearson’s X^2 estimate of scale. |
fit(Y) | |
has_intercept() | Check if column of 1s is in column space of design |
information(beta[, nuisance]) | Returns the information matrix at (beta, Y, nuisance). |
initialize(design) | |
logL(beta, Y[, nuisance]) | Returns the value of the loglikelihood function at beta. |
next() | |
predict([design]) | After a model has been fit, results are (assumed to be) stored |
rank() | Compute rank of design matrix |
score(beta, Y[, nuisance]) | Returns the score function, the gradient of the loglikelihood function at (beta, Y, nuisance). |
whiten(X) | Whitener for WLS model, multiplies by sqrt(self.weights) |
Continue iterating, or has convergence been obtained?
Return (unnormalized) log-likelihood for GLM.
Note that self.scale is interpreted as a variance in old_model, so we divide the residuals by its sqrt.
Return Pearson’s X^2 estimate of scale.
Check if column of 1s is in column space of design
Returns the information matrix at (beta, Y, nuisance).
See logL for details.
Parameters : | beta : ndarray
nuisance : dict
|
---|---|
Returns : | info : array
|
Returns the value of the loglikelihood function at beta.
Given the whitened design matrix, the loglikelihood is evaluated at the parameter vector, beta, for the dependent variable, Y and the nuisance parameter, sigma.
Parameters : | beta : ndarray
Y : ndarray
nuisance : dict, optional
|
---|---|
Returns : | loglf : float
|
Notes
The log-Likelihood Function is defined as .. math:
\ell(\beta,\sigma,Y)=
-\frac{n}{2}\log(2\pi\sigma^2) - \|Y-X\beta\|^2/(2\sigma^2)
The parameter above is what is sometimes referred to as a
nuisance parameter. That is, the likelihood is considered as a function
of
, but to evaluate it, a value of
is
needed.
If is not provided, then its maximum likelihood
estimate:
is plugged in. This likelihood is now a function of only
and is technically referred to as a profile-likelihood.
References
[R1] |
|
After a model has been fit, results are (assumed to be) stored in self.results, which itself should have a predict method.
Compute rank of design matrix
Returns the score function, the gradient of the loglikelihood function at (beta, Y, nuisance).
See logL for details.
Parameters : | beta : ndarray
Y : ndarray
nuisance : dict, optional
|
---|---|
Returns : | The gradient of the loglikelihood function. : |
Whitener for WLS model, multiplies by sqrt(self.weights)