Raise the order of a ctsem model's latent processes.
Source:R/ctModelHigherOrder.R
ctModelHigherOrder.RdEach latent in indices gains a derivative latent (named d
and the latent's name), which drives the level with a fixed unit
coefficient. That makes each a damped oscillator: a second order process,
whose autocorrelation can dip below zero and rise again, which no first
order process can.
Usage
ctModelHigherOrder(
ctm,
indices,
diffusion = TRUE,
crosseffects = FALSE,
cint = FALSE,
explosive = FALSE
)Arguments
- ctm
ctModel,
type = 'ct'ortype = 'omx'.- indices
Vector of integers, which latents to raise the order of.
- diffusion
Move the process noise from the level to its derivative?
- crosseffects
Move the effects of the other processes on this one to its derivative (divided by \(\tau\), for a
type = 'ct'model)? For atype = 'omx'model, its effects on them move as well.- cint
Move the continuous intercept to the derivative (divided by \(\tau\), for a
type = 'ct'model)?- explosive
For a
type = 'omx'model, allow explosive (non equilibrium returning) processes. Atype = 'ct'model's level keeps its own drift's transform, which decides that.
Details
A model from ctModel(type = 'ct') is rewritten cell by cell on its
parameter table, with a new inertia time \(\tau > 0\) for each latent
(inertia_ and the latent's name, in PARS):
$$\tau \ddot{x} + \dot{x} = a x + q \, dW,$$
where \(a\) is the level's own drift and \(q\) its diffusion, both
keeping their names and every setting – transform, individual variation,
predictor effects. The derivative's row of DRIFT reads \(a/\tau\)
and \(-1/\tau\), and its diffusion \(q/\tau\). As \(\tau\) goes to
zero the derivative follows the level at once and the process is the
first order one it was, so the new model contains the old one with every
old parameter at its value; from \(\tau = 1/(4|a|)\) on, the process
oscillates. The derivative starts where the process alone holds it at
equilibrium: mean zero, uncorrelated with every state, and variance
\(q^2/(2\tau)\), so the inertia time is the one new parameter. With the
noise left on the level (diffusion = FALSE), or none, its initial
mean, variance and covariances are free.
A model in the older matrix-list form from ctModel(type = 'omx') is
written instead as the derivative pulled back by the level through an
estimated coefficient (negative unless explosive), with the level's
own autoregression as the derivative's damping. That is the same family of
processes, but its first order member is reached only as the damping, the
coefficient and the diffusion all grow without bound.