Learn R Programming

stpm (version 1.7.12)

spm_con_1d: 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
)

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.

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 \(a\). The initial value will be predicted if not specified.

b

The initial value for the paramter \(b\). The initial value will be predicted if not specified.

q

The initial value for the paramter \(q\). The initial value will be predicted if not specified.

f

The initial value for the paramter \(f\). The initial value will be predicted if not specified.

f1

The initial value for the paramter \(f_1\). The initial value will be predicted if not specified.

mu0

The initial value for the paramter \(\mu_0\) in the baseline hazard. The initial value will be predicted if not specified.

theta

The initial value for the paramter \(\theta\) in the baseline hazard. The initial value will be predicted if not specified.

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.

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

Run this code
{ 
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)
}

Run the code above in your browser using DataLab