spm_cont_quad_lin: Continuous multi-dimensional optimization with quadratic and...

View source: R/spm_continuous_quadratic_linear.R

spm_cont_quad_linR Documentation

Continuous multi-dimensional optimization with quadratic and linear terms

Description

Continuous multi-dimensional optimization with quadratic and linear terms

Usage

spm_cont_quad_lin(
  dat,
  a = -0.05,
  f1 = 80,
  Q = 2e-08,
  f = 80,
  b = 5,
  mu0 = 2e-05,
  theta = 0.08,
  Q1 = 1e-08,
  stopifbound = FALSE,
  lb = NULL,
  ub = NULL,
  verbose = FALSE,
  pinv.tol = 0.01,
  gomp = FALSE,
  opts = list(algorithm = "NLOPT_LN_NELDERMEAD", maxeval = 100, ftol_rel = 1e-08)
)

Arguments

dat

A data table.

a

A starting value of the rate of adaptive response to any deviation of Y from f1(t).

f1

A starting value of the average age trajectories of the variables which process is forced to follow.

Q

Starting values of the quadratic hazard term.

f

A starting value of the "optimal" value of variable which corresponds to the minimum of hazard rate at a respective time.

b

A starting value of a diffusion coefficient representing a strength of the random disturbance from Wiener Process.

mu0

A starting value of the baseline hazard.

theta

A starting value of the parameter theta (axe displacement of Gompertz function).

Q1

Q for linear term

stopifbound

Estimation stops if at least one parameter achieves lower or upper boundaries. #'Check the NLopt website for a description of the algorithms. Default: NLOPT_LN_NELDERMEAD

lb

Lower bound of parameters under estimation.

ub

Upper bound of parameters under estimation. The program stops when the number of function evaluations exceeds maxeval. Default: 500.

verbose

An indicator of verbosing output.

pinv.tol

A tolerance value for pseudo-inverse of matrix gamma (see Yashin, A.I. et al (2007). Stochastic model for analysis of longitudinal data on aging and mortality. Mathematical Biosciences, 208(2), 538-551.<DOI:10.1016/j.mbs.2006.11.006>.)

gomp

A flag (FALSE by default). When it is set, then time-dependent exponential form of mu0 is used: mu0 = mu0*exp(theta*t).

opts

A list of options for nloptr. Default value: opt=list(algorithm="NLOPT_LN_NELDERMEAD", maxeval=100, ftol_rel=1e-8). Please see nloptr documentation for more information.

Details

spm_continuous runs much slower that discrete but more precise and can handle time intervals with different lengths.

Value

A set of estimated parameters a, f1, Q, f, b, mu0, theta and additional variable limit which indicates if any parameter achieved lower or upper boundary conditions (FALSE by default).

status Optimization status (see documentation for nloptr package).

LogLik A logarithm likelihood.

objective A value of objective function (given by nloptr).

message A message given by nloptr optimization function (see documentation for nloptr package).

References

Yashin, A.I. et al (2007). Stochastic model for analysis of longitudinal data on aging and mortality. Mathematical Biosciences, 208(2), 538-551.<DOI:10.1016/j.mbs.2006.11.006>.

Examples

library(stpm)
set.seed(123)
#Reading the data:
data <- simdata_cont(N=2)
head(data)
#Parameters estimation:
pars <- spm_cont_quad_lin(dat=data,a=-0.05, f1=80, 
					           Q=2e-8, f=80, b=5, mu0=2e-5, Q1=1e-08)
pars


stpm documentation built on Sept. 5, 2022, 5:06 p.m.