simdata_cont: Multi-dimensional simulation function for continuous-time...

View source: R/simdata_cont.R

simdata_contR Documentation

Multi-dimensional simulation function for continuous-time SPM.

Description

Multi-dimensional simulation function for continuous-time SPM.

Usage

simdata_cont(
  N = 10,
  a = -0.05,
  f1 = 80,
  Q = 2e-08,
  f = 80,
  b = 5,
  mu0 = 1e-05,
  theta = 0.08,
  ystart = 80,
  tstart = 30,
  tend = 105,
  dt = 1,
  sd0 = 1,
  nobs = NULL,
  gomp = TRUE,
  format = "long"
)

Arguments

N

Number of individuals.

a

A k by k matrix, represents the adaptive capacity of the organism

f1

A trajectory that corresponds to the long-term average value of the stochastic process Y(t), which describes a trajectory of individual covariate (physiological variable) influenced by different factors represented by a random Wiener process W(t). This is a vector with length of k.

Q

A matrix k by k, which is a non-negative-definite symmetric matrix, represents a sensitivity of risk function to deviation from the norm.

f

A vector with length of k, represents the normal (or optimal) state of physiological variable.

b

A diffusion coefficient, k by k matrix, characterizes a strength of the random disturbances from Wiener process W(t).

mu0

A baseline mortality.

theta

A displacement coefficient.

ystart

A vector with length equal of k, defines starting values of covariates.

tstart

A number that defines starting time (30 by default).

tend

A number, defines final time (105 by default).

dt

A discrete step size between two observations. A random uniform value is then added to this step size.

sd0

a standard deviation for modelling the next covariate value.

nobs

A number of observations (lines) for individual observations.

gomp

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

format

Data format: "long" (default), "short".

Value

A table with simulated data.

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)
dat <- simdata_cont(N=50)
head(dat)


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