bpt_rp | R Documentation |
A function to fit BPT renewal model
bpt_rp(data, t, m, y)
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) |
returns list of estimates after fitting BPT renewal model
Estimated parameter (mu) of the BPT model
Estimated parameter (alpha) of the BPT model
Negative log-likelihood
Akaike information criterion (AIC)
Bayesian information criterion (BIC)
Estimated mean
Estimated (logit) probabilities
Estimated (log) hazard rates
set.seed(42) data <- rgamma(30,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 probablity # fit BPT renewal model result <- marp::bpt_rp(data, t, m, y) # print result cat("par1 = ", result$par1, "\n") cat("par2 = ", result$par2, "\n") cat("logL = ", result$logL, "\n") cat("AIC = ", result$AIC, "\n") cat("BIC = ", result$BIC, "\n") cat("mu_hat = ", result$mu_hat, "\n") cat("pr_hat = ", result$pr_hat, "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.