predict.nhm {nhm}R Documentation

Compute state occupation or transition probabilities from a fitted nhm model

Description

Outputs the transition probabilites from a non-homogeneous Markov or misclassification type hidden Markov multi-state model fitted using nhm.

Usage

## S3 method for class 'nhm'
predict(object, time0=0, state0=1, times=NULL, covvalue=NULL,
ci=TRUE, sim=FALSE, coverage=0.95, B=1000, rtol=1e-6,
atol=1e-6, ...)

Arguments

object

Fitted model object produced using nhm.

time0

Starting time from which to compute the transition probabilities. Defaults to 0.

state0

Starting state from which to compute the transition probabilities. Defaults to 1.

times

Optional vector of times at which to compute the transition probabilities. If omitted, the probabilities will be computed at a sequence of times from time0 to the maximum observed time in the data.

covvalue

Optional vector of covariate vectors (should be given in the order specified in the covariate option in nhm). If omitted the function will use the mean values of the covariates.

ci

If TRUE pointwise confidence intervals will be shown in addition to the point estimates.

sim

If TRUE a simulation Delta method (Mandel, 2013) will be used to calculate the confidence intervals. Otherwise the standard Delta method will be applied.

coverage

Coverage level (should be a value between 0 and 1) for the confidence intervals. Defaults to 0.95.

B

Number of simulations to be performed to compute the simulation Delta method.

rtol

Relative tolerance parameter to be used by lsoda when solving the differential equations

atol

Absolute tolerance parameter to be used by lsoda when solving the differential equations

...

Other items to be passed to the function. Currently not used.

Details

The same approach as in the main nhm function of numerically solving the system of differential equations is used to compute transition probabilities based on the maximum likelihood estimates found in nhm and assuming a specific vector of covariates.

If the simulation delta method approach is specified then the function will generate B parameter vectors from the asymptotic distribution of the MLE and solve the system of equations for each of them, before finding pointwise percentile bootstrap confidence intervals from them.

Value

Returns a list containing the vector of times at which the probabilities are computed, a matrix of probabilities for each state at each of the times. If confidence intervals are requested then the lower and upper limits are also provided.

If transition intensity (as opposed to probability) estimates are required then qmatrix.nhm should be used.

Author(s)

Andrew Titman a.titman@lancaster.ac.uk

References

Mandel M. Simulation-based confidence intervals for functions with complicated derivatives. 2013. The American Statistician, 67. 76-81.

See Also

nhm, plot.nhm, qmatrix.nhm


[Package nhm version 0.1.1 Index]