# NOT RUN {
#Using the ozone data
data(ozone)
attach(ozone)
#################################
#The model
ti <- dailyozonelevel
#Initial values for the parameters
initial <- mmmeth(ti)
alpha0 <- initial$alpha0ini
beta0 <- initial$beta0init
lambda0 <- 0
delta0 <- lambda0/sqrt(1+lambda0^2)
#Estimated parameters of the model (by default)
est_param <- EMbssn(ti,alpha0,beta0,delta0,loglik=T,
accuracy = 1e-8,show.envelope = "TRUE", iter.max=500)
#ML estimates
alpha <- est_param$res$alpha
beta <- est_param$res$beta
lambda <- est_param$res$lambda
#########################################
#A simple output example
---------------------------------------------------------
Birnbaum-Saunders model based on Skew-Normal distribution
---------------------------------------------------------
Observations = 116
-----------
Estimates
-----------
Estimate Std. Error z value Pr(>|z|)
alpha 1.26014 0.23673 5.32311 0.00000
beta 14.65730 4.01984 3.64624 0.00027
lambda 1.06277 0.54305 1.95706 0.05034
------------------------
Model selection criteria
------------------------
Loglik AIC BIC HQC
Value -542.768 4.705 4.741 4.719
-------
Details
-------
Iterations = 415
Processing time = 0.4283214 secs
Convergence = TRUE
# }
Run the code above in your browser using DataLab