deglmx {SPREDA} | R Documentation |
Functions for estimating parameters in the linear/nonlinear mixed models with dynamic covariates.
Description
Functions for estimating parameters in the linear/nonlinear mixed models with dynamic covariates. Those dynamic covariates will have restricted-shape effects such as monotonic increasing, decreasing or quadratic shape.
Usage
deglmx(fixed, data, dyn.data, id, time, random = NULL, linear = TRUE, ytrend,
splinetrend = NULL, splinetype = NULL, degree = NULL, knots = NULL,
weights = NULL, subset = NULL, start, maxiter = 10, method = "BFGS", ...)
Arguments
fixed |
Formula with fixed effect. |
data |
Data with id, time, response, and fixed covariates. |
dyn.data |
Dynamic data with id, time, dynamic covariates. |
id |
The name of the id which is characters or string. |
time |
The name of time in the data or dyn.data which is characters or string. |
random |
The formula for random parts which should condition on the id. |
linear |
The index of linear or nonlinear. |
ytrend |
If ytrend=1 indicates the increasing trend of the response, if ytrend=-1 indicates the decreasing trend of the response. |
splinetrend |
They are a vector of trends of dynamic covariate effects. Define 1 as increasing trend and -1 as decreasing trend. |
splinetype |
They are a vector of the spline basis type which can be chosen among "Ms", "Is", and "Cs". |
degree |
The degree of the spline functions. |
knots |
The number of knots in the spline functions. |
weights |
Weights of the observation. |
subset |
Subset of the data. |
start |
The initial values for covariance and variance matrix. |
maxiter |
The maximum number of iteration in the optimization. |
method |
The method of optim function with "BFGS" as default. More details in optim. |
... |
Other items. |
Value
The returned outputs belong to class of "deglmx". list(type = type, fit = fit, dat = dat.obj, dyn.mat = cov.mat.tmp, ytrend = ytrend, dyncovnames = dyncovnames, dyn.data = dyn.data, beta.index = beta.index, call = mfun)
type |
Type of the model either linear mixed or nonlinear mixed models. |
fit |
The fitting results in the model including estimates, residuals, loglikelihood, and so on. |
dat |
The modified data. |
dyn.mat |
The spline basis functions. |
ytrend |
The indication of response trend either increasing (1) or decreasing (-1). |
dyncovnames |
Names of dynamic covariates in the model. |
dyn.data |
The modified dynamic data. |
beta.index |
Indications of parameters in the dyanmic covariates. |
call |
The call function in the model. |
Note
For the nonlinear model, we currently only implement one specific nonlinear relationship.
Author(s)
Yili Hong
References
Hong. Y., Y. Duan, W. Q. Meeker, D. L. Stanley, and X. Gu (2014), Statistical Methods for Degradation Data with Dynamic Covariates Information and an Application to Outdoor Weathering Data, Technometrics, DOI: 10.1080/00401706.2014.915891.
Examples
data(Coatingenv)
data(Coatingout)
fit=deglmx(DAMAGE_Y~UV+RH+TEMP, data=Coatingout, dyn.data=Coatingenv,
id="SPEC_NUM", time="TIME", random=~TIME|SPEC_NUM, linear=TRUE, ytrend=-1,
splinetrend=c(-1, -1, -1), splinetype=c("Is", "Cs", "Is"), degree=c( 3, 3, 3),
knots=c(4, 4, 4), weights=NULL, subset=NULL,start=c(0.017,0.0013,-0.404,0.0176),
maxiter=10, method='BFGS')
fit=deglmx(DAMAGE_Y~G/(1+exp(-log(UV+RH+TEMP)/H)), data=Coatingout, dyn.data=Coatingenv,
id="SPEC_NUM", time="TIME", random=~G+H|SPEC_NUM, linear=FALSE, ytrend=-1,
splinetrend=c(1, 1, 1), splinetype=c("Is", "Cs", "Is"), degree=c( 3, 3, 3),
knots=c(4, 4, 4), weights=NULL, subset=NULL, start=c(0.1, 0.1, -0.5, 0.01),
maxiter=4)