seg.lm.fit | R Documentation |
seg.lm.fit
is called by segmented.lm
to fit segmented linear
(gaussian) models. Likewise, seg.glm.fit
is called by segmented.glm
to fit
generalized segmented linear models, and seg.def.fit
is called by segmented.default
to fit
segmented relationships in general regression models (e.g., quantile regression and Cox regression). seg.lm.fit.boot
,
seg.glm.fit.boot
, and seg.def.fit.boot
are employed to perform bootstrap restart.
The functions segConstr.*
are called by segreg()
when some contraints are set on the slopes of the segmented relationships.
These functions should usually not be used directly by the user.
seg.lm.fit(y, XREG, Z, PSI, w, offs, opz, return.all.sol=FALSE)
seg.lm.fit.boot(y, XREG, Z, PSI, w, offs, opz, n.boot=10,
size.boot=NULL, jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
seg.glm.fit(y, XREG, Z, PSI, w, offs, opz, return.all.sol=FALSE)
seg.glm.fit.boot(y, XREG, Z, PSI, w, offs, opz, n.boot=10,
size.boot=NULL, jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
seg.def.fit(obj, Z, PSI, mfExt, opz, return.all.sol=FALSE)
seg.def.fit.boot(obj, Z, PSI, mfExt, opz, n.boot=10, size.boot=NULL,
jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
seg.Ar.fit(obj, XREG, Z, PSI, opz, return.all.sol=FALSE)
seg.Ar.fit.boot(obj, XREG, Z, PSI, opz, n.boot=10, size.boot=NULL, jt=FALSE,
nonParam=TRUE, random=FALSE, break.boot=n.boot)
seg.num.fit(y, XREG, Z, PSI, w, opz, return.all.sol=FALSE)
seg.num.fit.boot(y, XREG, Z, PSI, w, opz, n.boot=10, size.boot=NULL, jt=FALSE,
nonParam=TRUE, random=FALSE, break.boot=n.boot)
segConstr.lm.fit(y, XREG, Z, PSI, w, offs, opz, return.all.sol = FALSE)
segConstr.lm.fit.boot(y, XREG, Z, PSI, w, offs, opz, n.boot=10, size.boot=NULL,
jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
segConstr.glm.fit(y, XREG, Z, PSI, w, offs, opz, return.all.sol = FALSE)
segConstr.glm.fit.boot(y, XREG, Z, PSI, w, offs, opz, n.boot=10, size.boot=NULL,
jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
y |
vector of observations of length |
XREG |
design matrix for standard linear terms. |
Z |
appropriate matrix including the segmented variables whose breakpoints have to be estimated. |
PSI |
appropriate matrix including the starting values of the breakpoints to be estimated. |
w |
possibe weights vector. |
offs |
possibe offset vector. |
opz |
a list including information useful for model fitting. |
n.boot |
the number of bootstrap samples employed in the bootstrap restart algorithm. |
break.boot |
Integer, less than |
size.boot |
the size of the bootstrap resamples. If |
jt |
logical. If |
nonParam |
if |
random |
if |
return.all.sol |
if |
obj |
the starting regression model where the segmented relationships have to be added. |
mfExt |
the model frame. |
The functions call iteratively lm.wfit
(or glm.fit
) with proper design matrix depending on
XREG
, Z
and PSI
. seg.lm.fit.boot
(and seg.glm.fit.boot
) implements the bootstrap restarting idea discussed in
Wood (2001).
A list of fit information.
These functions should usually not be used directly by the user.
Vito Muggeo
Wood, S. N. (2001) Minimizing model fitting objectives that contain spurious local minima by bootstrap restarting. Biometrics 57, 240–244.
segmented.lm
, segmented.glm
##See ?segmented
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.