Learn R Programming

stpm (version 1.1.2)

spm_time_dep: spm_time_dep : a function that estimates parameters from the model with time-dependent coefficients.

Description

spm_time_dep : a function that estimates parameters from the model with time-dependent coefficients.

Usage

spm_time_dep(x, start = list(a = -0.05, f1 = 80, Q = 2e-08, f = 80, b = 5, mu0
  = 0.001), f = list(at = "a", f1t = "f1", Qt = "Q", ft = "f", bt = "b", mu0t
  = "mu0"), stopifbound = FALSE, algorithm = "NLOPT_LN_NELDERMEAD",
  lb = NULL, ub = NULL, verbose = FALSE, maxeval = 100)

Arguments

x
: input data table.
start
: a list of starting parameters, default: list(a=-0.5, f1=80, Q=2e-8, f=80, b=5, mu0=1e-5),
f
: a list of formulas that define age (time) - dependency. Default: list(at="a", f1t="f1", Qt="Q", ft="f", bt="b", mu0t="mu0")
stopifbound
Estimation stops if at least one parameter achieves lower or upper boundaries.
algorithm
An optimization algorithm used, can be one of those: NLOPT_LN_NEWUOA,NLOPT_LN_NEWUOA_BOUND or NLOPT_LN_NELDERMEAD. Default: NLOPT_LN_NELDERMEAD
lb
Lower bound of parameters under estimation.
ub
Upper bound of parameters under estimation.
verbose
turns on verbosing output.
maxeval
maximum number of iterations of optimization algorithm.

Value

  • a set of estimated coefficients of a, f1, Q, f, b, mu0 and (if used) theta.

References

Yashin, A. et al (2007), Health decline, aging and mortality: how are they related? Biogerontology, 8(3), 291-302..

Examples

Run this code
library(stpm)
#Data preparation:
n <- 10
data <- simdata_time_dep(N=n)
# Estimation:
opt.par <- spm_time_dep(data)
opt.par

Run the code above in your browser using DataLab