PSM.estimate(Model, Data, Par, CI = FALSE, trace = 0, control=NULL, fast=TRUE)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data
is a list
containing: [object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
hessian
in the optim
f
and
g
can be used in PSM. In the folliwing, the name of the model
object is assumed to be MyModel
. First define the
functions MyModel$Functions$f
and
MyModel$Functions$g
. When these are defined in MyModel the
functions df
and dg
can be added to the model object by
writing as below:
MyModel$Functions$df = function(x,u,time,phi) { jacobian(MyModel$Functions$f,x=x,u=u,time=time,phi=phi) } MyModel$Functions$dg = function(x,u,time,phi) { jacobian(MyModel$Functions$g,x=x,u=u,time=time,phi=phi) }
This way of defining df
and dg
forces a numerical
evaluation of the Jacobians using the
$$dx_t = (A(\phi_i)x_t + B(\phi_i)u_t)dt + \sigma(\phi_i) d\omega_t$$ $$y_{ij} = C(\phi_i)x_{ij} + D(\phi_i)u_{ij} + e_{ij}$$
and for non-linear models as
$$dx_t = f(x_t,u_t,t,\phi_i)dt + \sigma(u_t,t,\phi_i) d\omega_t$$ $$y_{ij} = g(x_{ij},u_{ij},t_{ij},\phi_i) + e_{ij}$$
where $e_{ij} \sim N(0,S(u_{ij},t_{ij},\phi_i))$ and $\omega_t$ is a standard Brownian motion.
The second stage model describing inter-individual variations is defined as:
$$\phi_i = h(\eta_i,\theta,Z_i)$$
where $\eta_i \sim N(0,\Omega)$, $\theta$ are the fixed effect parameters and $Z_i$ are covariates for individual i. In a model without random-effects the function $h$ is only used to include possible covariates in the model.
PSM
.PSM
, PSM.smooth
,
PSM.simulate
, PSM.plot
, PSM.template
cat("Examples are included in the package vignette.
")
Run the code above in your browser using DataLab