spm_gen(dat, a = -0.05, f1 = 80, Q = 2e-08, f = 80, b = 5,
mu0 = 2e-05, theta = 0.08, p = 0.25, stopifbound = FALSE,
algorithm = "NLOPT_LN_COBYLA", lb = NULL, ub = NULL, maxeval = 500,
verbose = FALSE, pinv.tol = 0.01)
nloptr
.
#'Check the NLopt website for a description of
the algorithms. Default: NLOPT_LN_COBYLAnloptr
optimization.
The program stops when the number of function evaluations exceeds maxeval. Default: 500.limit
which indicates if any parameter
achieved lower or upper boundary conditions (FALSE by default).spm_continuous
runs much slower that discrete but more precise and can handle time intervals with different lengths.Yashin, A.I. et al (2007). Stochastic model for analysis of longitudinal data on aging
and mortality. Mathematical Biosciences, 208(2), 538-551.
library(stpm)
#Reading the data:
data <- simdata_gen(N=2)
head(data)
#Parameters estimation:
pars <- spm_gen(dat=data,a=-0.05, f1=80,
Q=2e-8, f=80, b=5, mu0=2e-5, theta=0.08)
pars
Run the code above in your browser using DataLab