spm_con_1d {stpm} | R Documentation |
Fitting a 1-D SPM model with constant parameters
Description
This function implements a analytical solution to estimate the parameters in the continuous SPM model by assuming all the parameters are constants.
Usage
spm_con_1d(
spm_data,
a = NA,
b = NA,
q = NA,
f = NA,
f1 = NA,
mu0 = NA,
theta = NA,
lower = c(),
upper = c(),
control = list(xtol_rel = 1e-06),
global = FALSE,
verbose = TRUE,
ahessian = FALSE
)
Arguments
spm_data |
A dataset for the SPM model. See the STPM package for more details about the format. |
a |
The initial value for the paramter |
b |
The initial value for the paramter |
q |
The initial value for the paramter |
f |
The initial value for the paramter |
f1 |
The initial value for the paramter |
mu0 |
The initial value for the paramter |
theta |
The initial value for the paramter |
lower |
A vector of the lower bound of the parameters. |
upper |
A vector of the upper bound of the parameters. |
control |
A list of the control parameters for the optimization paramters. |
global |
A logical variable indicating whether the MLSL (TRUE) or the L-BFGS (FALSE) algorithm is used for the optimization. |
verbose |
A logical variable indicating whether initial information is printed. |
ahessian |
A logical variable indicating whether the approximate (FALSE) or analytical (TRUE) Hessian is returned. |
Value
est The estimates of the parameters.
hessian The Hessian matrix of the estimates.
lik The minus log-likelihood.
con A number indicating the convergence. See the 'nloptr' package for more details.
message Extra message about the convergence. See the 'nloptr' package for more details.
References
He, L., Zhbannikov, I., Arbeev, K. G., Yashin, A. I., and Kulminski, A.M., 2017. Genetic stochastic process model for detecting pleiotropic and interaction effects with longitudinal data.
Examples
{
library(stpm)
dat <- simdata_cont(N=500)
colnames(dat) <- c("id", "xi", "t1", "t2", "y", "y.next")
res <- spm_con_1d(as.data.frame(dat), a=-0.05, b=2, q=1e-8, f=80, f1=90, mu0=1e-3, theta=0.08)
}