# NOT RUN {
# NB the data to analyse needs to be in a data frame of a specific form
head(recovery_data_II)
# step #1: prepare nll function for analysis
m01_prep_function <- function(a2, b2, a3, b3){
nll_recovery_II(a2, b2, a3, b3,
data = recovery_data_II, # data_recovery_II,
d2 = "Weibull", d3 = "Weibull"
)}
# step #2: send 'prep_function' to mle2 for maximum likelihood estimation,
# specifying starting values
m01 <- mle2(m01_prep_function,
start = list(a2 = 2, b2 = 0.5, a3 = 2, b3 = 0.5)
)
summary(m01)
# values used to simulate data were for the Weibull distribution;
# a2 = 2.2, b2 = 0.35, a3 = 2.35, b3 = 0.35
# }
Run the code above in your browser using DataLab