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)#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:
The set of times at which the state occupation probabilities are computed.
Matrix of state occupation probability estimates
Array of variance-covariance estimates of the state occupation probability estimates at each time.
Lower limits of component-wise confidence intervals
Upper limits of component-wise confidence intervals
Value of the initial probability vector at time tstart calculated from the model.
Fitted model object produced using nhm.
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.
Starting time from which to compute the state occupation probabilities. Defaults to 0.
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.
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 tstart correspond to those implied by the left-truncation model.
If ltrunc supplied will similarly calculate based on left-truncation from the value of t0 supplied. If model does not include misclassification, will assume entry in state 1.
Optional list containing ltruncation_time and ltruncation_states. If supplied will replace the values in the original model fit object.
Relative tolerance parameter to be used by lsoda when solving the differential equations
Absolute tolerance parameter to be used by lsoda when solving the differential equations
Logical for whether confidence intervals should be calculated for the quantities.
Logical for whether simulation-based (parametric bootstrap) confidence intervals should be used (TRUE) or delta method-based intervals (FALSE).
Argument for internal use to faciliate parametric bootstrapping: default "main" ensures standard errors and calculated, if mode="boot" then standard errors are not calculated.
Integer specifying the number of bootstrap replicates to perform if sim=TRUE. Defaults to 1000.
Nominal coverage proportion required for confidence intervals. Defaults to 0.95 implying two-sided 95% confidence intervals.
Logical to determine whether latent states should be merged for models fitted using the phasemap option. If TRUE will return estimates for the number of observable states.
Andrew Titman a.titman@lancaster.ac.uk
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
expected_hitting_time, state_life_expectancy