View source: R/state_occupancy_routines.R
state_occupation_probability.nhm | R Documentation |
Outputs the state occupation probabilities from a non-homogeneous Markov or misclassification type hidden Markov multi-state model fitted using nhm
.
state_occupation_probability.nhm(model, covvalue=NULL, time0 = 0, times = NULL,
initp = NULL, ltrunc = NULL, rtol = 1e-06, atol = 1e-06, ci = TRUE, sim = FALSE,
mode = "main", B = 1000, coverage = 0.95, statemerge = FALSE)
model |
Fitted model object produced using |
covvalue |
Vector of covariate vectors (should be given in the order specified in the |
time0 |
Starting time from which to compute the state occupation probabilities. Defaults to 0. |
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 |
initp |
optional vector of initial state occupation probabilities. If NULL then will use the estimates from the model. If original model was left-truncated will assume probabilities at |
ltrunc |
Optional list containing |
rtol |
Relative tolerance parameter to be used by |
atol |
Absolute tolerance parameter to be used by |
ci |
Logical for whether confidence intervals should be calculated for the quantities. |
sim |
Logical for whether simulation-based (parametric bootstrap) confidence intervals should be used ( |
mode |
Argument for internal use to faciliate parametric bootstrapping: default |
B |
Integer specifying the number of bootstrap replicates to perform if |
coverage |
Nominal coverage proportion required for confidence intervals. Defaults to 0.95 implying two-sided 95% confidence intervals. |
statemerge |
Logical to determine whether latent states should be merged for models fitted using the |
The state occupation probabilities are computed by summing over the transition probabilites from time0
with respect to the initial state occupation probabilities.
For models with left-truncation, if time0
is greater than the time origin in the model (ltruncation_time
) then the function will calculate the state occupation probabilites at time0
assuming subjects are sampled conditional on being in the ltruncation_states
#out <- list(times= times, ests=ests, ests_cov = ests_cov, ests_low=ests_low, ests_high=ests_high, initp=initp)
Returns a list with the following components:
times |
The set of times at which the state occupation probabilities are computed. |
ests |
Matrix of state occupation probability estimates |
ests_cov |
Array of variance-covariance estimates of the state occupation probability estimates at each time. |
ests_low |
Lower limits of component-wise confidence intervals |
ests_high |
Upper limits of component-wise confidence intervals |
initp |
Value of the initial probability vector at time |
Andrew Titman a.titman@lancaster.ac.uk
expected_hitting_time
, state_life_expectancy
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.