weibull_rp {marp}R Documentation

A function to fit Weibull renewal model #' @import weibull_logl

Description

A function to fit Weibull renewal model #' @import weibull_logl

Usage

weibull_rp(data, t, m, y)

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)

Value

returns list of estimates after fitting Weibull renewal model

par1

Estimated scale parameter of the Weibull model

par2

Estimated shape parameter of the Weibull model

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

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 probablity

# fit Weibull renewal model
result <- marp::weibull_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")


[Package marp version 0.1.0 Index]