File: step.lm.fit.Rd

package info (click to toggle)
r-cran-segmented 2.1-4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,484 kB
  • sloc: makefile: 2
file content (124 lines) | stat: -rw-r--r-- 4,628 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\name{step.lm.fit}
\alias{step.lm.fit}
\alias{step.glm.fit}
\alias{step.num.fit}
\alias{step.ts.fit}
\alias{step.lm.fit.boot}
\alias{step.glm.fit.boot}
\alias{step.num.fit.boot}
\alias{step.ts.fit.boot}

%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Fitter Functions for stepmented Linear Models
}
\description{
\code{step.lm.fit} is called by \code{stepmented.lm} to fit stepmented linear 
(gaussian) models.  Likewise, \code{step.glm.fit} is called by \code{stepmented.glm} to fit  
generalized stepmented linear models.
%, and \code{step.def.fit} is called by \code{stepmented.default} to fit  
%stepmented relationships in general regression models (e.g., quantile regression and Cox regression). 
The \code{step.*.fit.boot} functions are employed to perform bootstrap restarting. 
These functions should usually not be used directly by the user.
}
\usage{
step.lm.fit(y, x.lin, Xtrue, PSI, ww, offs, opz, return.all.sol=FALSE)  

step.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)                          

step.glm.fit(y, x.lin, Xtrue, PSI, ww, offs, opz, return.all.sol=FALSE)

step.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)
%step.def.fit(obj, Z, PSI, mfExt, opz, return.all.sol=FALSE)
%step.def.fit.boot(obj, Z, PSI, mfExt, opz, n.boot=10, size.boot=NULL, 
 %   jt=FALSE, nonParam=TRUE, random=FALSE, break.boot=n.boot)
%step.Ar.fit(obj, XREG, Z, PSI, opz, return.all.sol=FALSE)
%step.Ar.fit.boot(obj, XREG, Z, PSI, opz, n.boot=10, size.boot=NULL, jt=FALSE,
 %   nonParam=TRUE, random=FALSE, break.boot=n.boot)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{y}{
vector of observations of length \code{n}.
}
  \item{x.lin, XREG}{
design matrix for standard linear terms.
}
  \item{Xtrue, Z}{
appropriate matrix including the stepmented variables whose breakpoints have to be estimated.
}
  \item{PSI}{
  appropriate matrix including the starting values of the breakpoints to be estimated.
}
  \item{ww,w}{
  possibe weights vector.
}
  \item{offs}{
  possibe offset vector.
}
  \item{opz}{
  a list including information useful for model fitting.
}
  \item{n.boot}{
  the number of bootstrap samples employed in the bootstrap restart algorithm.
}
  \item{break.boot}{
  Integer, less than \code{n.boot}. If \code{break.boot} consecutive bootstrap samples lead to the same objective function, the algorithm stops without performing all \code{n.boot} 'trials'.
  This can save computational time considerably.
}
  \item{size.boot}{
  the size of the bootstrap resamples. If \code{NULL} (default), it is taken equal to the sample size.
  values smaller than the sample size are expected to increase perturbation in the bootstrap resamples.
}
  \item{jt}{
  logical. If \code{TRUE} the values of the stepmented variable(s) are jittered before fitting the model to the
  bootstrap resamples.
}
  \item{nonParam}{
  if \code{TRUE} nonparametric bootstrap (i.e. case-resampling) is used, otherwise residual-based.

}
  \item{random}{
  if \code{TRUE}, when the algorithm fails to obtain a solution, random values are used as candidate values.
}
  \item{return.all.sol}{
  if \code{TRUE}, when the algorithm fails to obtain a solution, the values visited by the algorithm
  with corresponding deviances are returned.
}
%  \item{obj}{
%  the starting regression model where the stepmented relationships have to be added.
%}
%  \item{mfExt}{
%  the model frame.
%}

}
\details{
The functions call iteratively \code{lm.wfit} (or \code{glm.fit}) with proper design matrix depending on 
\code{XREG}, \code{Z} and \code{PSI}. \code{step.lm.fit.boot} (and \code{step.glm.fit.boot}) implements the bootstrap restarting idea discussed in
Wood (2001).
}
\value{
A list of fit information.
}
\references{ Wood, S. N. (2001) Minimizing model fitting objectives that contain spurious local minima
    by bootstrap restarting. \emph{Biometrics} \bold{57}, 240--244. }
\author{ Vito Muggeo }
\note{
These functions should usually not be used directly by the user.
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
\code{\link{stepmented.lm}} or \code{\link{stepmented.glm}}
}
\examples{
##See ?stepmented
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{regression}
\keyword{nonlinear }