|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.regression.linear.glm.IWLS
public class IWLS
This implementation estimates parameters β in a GLM model using the Iteratively Re-weighted Least Squares algorithm. The idea is that, at each iteration, we regress the adjusted, weighted, dependent variables on the same design matrix.
The R equivalent function isglm.fit.
| Constructor Summary | |
|---|---|
IWLS(double threshold,
int maxIterations)
Construct an instance to run the Iteratively Re-weighted Least Squares algorithm. |
|
| Method Summary | |
|---|---|
ImmutableVector |
betaHat()
Get the estimates of β, β^, as in E(Y) = μ = g-1(Xβ) |
void |
fit(GLMProblem probelm,
Vector beta0Initial)
Fit a Generalized Linear Model. |
double |
logLikelihood()
|
ImmutableVector |
mu()
Get μ as in E(Y) = μ = g-1(Xβ) |
ImmutableVector |
weights()
Get the weights assigned to the observations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IWLS(double threshold,
int maxIterations)
threshold - the convergence thresholdmaxIterations - maximum number of iterations| Method Detail |
|---|
public void fit(GLMProblem probelm,
Vector beta0Initial)
GLMFitting
fit in interface GLMFittingprobelm - the generalized linear regression problem to be solvedbeta0Initial - initial guess for β^public ImmutableVector mu()
GLMFittingE(Y) = μ = g-1(Xβ)
mu in interface GLMFittingpublic ImmutableVector betaHat()
GLMFittingE(Y) = μ = g-1(Xβ)
betaHat in interface GLMFittingpublic ImmutableVector weights()
GLMFitting
weights in interface GLMFittingpublic double logLikelihood()
logLikelihood in interface GLMFitting
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||