public class IWLS extends java.lang.Object implements Fitting
The R equivalent function is glm.fit.
| Modifier and Type | Field and Description |
|---|---|
int |
maxIterations
the maximum number of iterations
|
double |
threshold
the convergence threshold
|
| Constructor and Description |
|---|
IWLS(double threshold,
int maxIterations)
Construct an instance to run the Iteratively Re-weighted Least Squares algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
ImmutableVector |
betaHat()
Get the estimates of β, β^, as in
|
void |
fit(GLMProblem probelm,
Vector beta0Initial)
Fit a Generalized Linear Model.
|
double |
logLikelihood() |
ImmutableVector |
mu()
Get μ as in
|
ImmutableVector |
weights()
Get the weights to the observations.
|
public final double threshold
public final int maxIterations
public IWLS(double threshold,
int maxIterations)
threshold - the convergence thresholdmaxIterations - maximum number of iterationspublic void fit(GLMProblem probelm, Vector beta0Initial)
FittingThis method must be called before the three get methods.
public ImmutableVector mu()
Fitting
E(Y) = μ = g-1(Xβ)
public ImmutableVector betaHat()
Fitting
E(Y) = μ = g-1(Xβ)
public ImmutableVector weights()
Fittingpublic double logLikelihood()
logLikelihood in interface Fitting