marp {marp} | R Documentation |
A function to apply model-averaged renewal process
Description
A function to apply model-averaged renewal process
Usage
marp(data, t, m, y, which.model = 1)
Arguments
data |
input inter-event times |
t |
user-specified time intervals (used to compute hazard rate) |
m |
the number of iterations in nlm |
y |
user-specified time point (used to compute time-to-event probability) |
which.model |
user-specified generating (or true underlying if known) model |
Value
returns list of estimates obtained from different renewal processes and after applying model-averaging
- par1
Estimated scale parameters (if applicable) of all six renewal models
- par2
Estimated shape parameters (if applicable) of all six renewal models
- logL
Negative log-likelihood
- AIC
Akaike information criterion (AIC)
- BIC
Bayesian information criterion (BIC)
- mu_hat
Estimated mean
- pr_hat
Estimated (logit) probabilities
- haz_hat
Estimated (log) hazard rates
- weights_AIC
Model weights calculated based on AIC
- weights_BIC
Model weights calculated based on BIC
- model_best
Model selected based on the lowest AIC
- mu_best
Estimated mean obtained from the model with the lowest AIC
- pr_best
Estimated probability obtained from the model with the lowest AIC
- haz_best
Estimated hazard rates obtained from the model with the lowest AIC
- mu_gen
Estimated mean obtained from the (true or hypothetical) generating model
- pr_gen
Estimated probability obtained from the (true or hypothetical) generating model
- haz_gen
Estimated hazard rates obtained from the (true or hypothetical) generating model
- mu_aic
Estimated mean obtained from model-averaging (using AIC weights)
- pr_aic
Estimated probability obtained from model-averaging (using AIC weights)
- haz_aic
Estimated hazard rates obtained from model-averaging (using AIC weights)
Examples
set.seed(42)
data <- rgamma(100,3,0.01)
# set some parameters
m = 10 # number of iterations for MLE optimization
t = seq(100, 200, by=10) # time intervals
y = 304 # cut-off year for estimating probability
which.model <- 2 # specify the generating model
# model selection and averaging
result <- marp::marp(data, t, m, y, which.model)