Learn R Programming

PSM (version 0.8-6)

PSM.estimate: Estimate population parameters

Description

Estimates population parameters in a linear or non-linear mixed effects model based on stochastic differential equations by use of maximum likelihood and the Kalman filter.

Usage

PSM.estimate(Model, Data, Par, CI = FALSE, trace = 0, control=NULL, fast=TRUE)

Arguments

Model
A list containing the following elements:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Data
An unnamed list where each element contains data for one individual. Each element in Data is a list containing:

[object Object],[object Object],[object Object],[object Object]

Par
A list containing the following elements:

[object Object],[object Object]

CI
Boolean. If true, the program estimates 95% confidence intervals, standard deviation and correlation matrix for the parameter estimates based on the Hessian of the likelihood function. The Hessian is estimated by hessian in the
trace
Non-negative integer. If positive, tracing information on the progress of the optimization is produced. Higher values produces more tracing information.
control
A list of control parameters for the optimization of the likelihood function. The list has one required component, namely: [object Object] The remaining components in the list are given as the control argument for the chosen optimizer. See
fast
Boolean. Use compiled Fortran code for faster estimation.

Value

  • A list containing the following elements:
  • NegLogLValue of the negative log-likelihood function at optimum.
  • THETAPopulation parameters at optimum
  • CI95% confidence interval for the estimated parameters
  • SDStandard deviation for the estimated parameters
  • CORCorrelation matrix for the estimated parameters
  • secTime for the estimation in seconds
  • optRaw output from optim

Numerical Jacobians of f and g

Automatic numerical approximations of the Jacobians of 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 numDeriv package. It may be usefull in some cases, but it should be stressed that it will probably give at least a ten-fold increase in estimation times.

Details

The first stage model describing intra-individual variations is for linear models defined as

$$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.

References

Please visit http://www.imm.dtu.dk/psm or refer to the main help page for PSM.

See Also

PSM, PSM.smooth, PSM.simulate, PSM.plot, PSM.template

Examples

Run this code
cat("Examples are included in the package vignette.
")

Run the code above in your browser using DataLab