|
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
We estimate 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 is glm.fit.
| Field Summary | |
|---|---|
int |
maxIterations
the maximum number of iterations |
double |
threshold
the convergence threshold |
| 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 to the observations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final double threshold
public final int maxIterations
| 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)
FittingThis method must be called before the three get methods.
fit in interface Fittingprobelm - the generalized linear regression problem to be solvedbeta0Initial - initial guess for betaHatpublic ImmutableVector mu()
Fitting
E(Y) = μ = g-1(Xβ)
mu in interface Fittingpublic ImmutableVector betaHat()
Fitting
E(Y) = μ = g-1(Xβ)
betaHat in interface Fittingpublic ImmutableVector weights()
Fitting
weights in interface Fittingpublic double logLikelihood()
logLikelihood in interface Fitting
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||