#Default example
#Example. Left-censoring, 10%
## Not run:
# set.seed(313177)
# n <- 500
# out <- rcarma(n, ar=0.8, ma=-0.6, mu=100, siga=15, rates=c(0.1, NA))
# y <- out$y
# iy <- out$iy
# ans <- cenarma(y, iy, p=1, q=1)
# ans[[1]]
# #
# #Example ARMA(1,1) with missing values.
# #Fit using arima() and cenarma()
# #compare final relative likelihood and difference log-likelihoods
# set.seed(313177)
# n <- 500
# out <- rcarma(n, ar=0.8, ma=-0.6, mu=100, siga=15, rates=c(NA, NA), Mrate=0.25)
# y <- out$y
# iy <- out$iy
# (ans0 <- arima(y, order=c(1,0,1)))
# (ans1 <- cenarma(y, iy, p=1, q=1))[[1]]
# logL0 <- ans0$loglik
# betaHat <- coef(ans1[[1]])
# arHat <- betaHat[1]
# maHat <- betaHat[2]
# muHat <- betaHat[3]
# ans1B <- arima(y, order=c(1,0,1), fixed=c(arHat,maHat,muHat),transform.pars=FALSE)
# logL1 <- ans1B$loglik
# RL <- exp(logL1-logL0)
# RL
# logL1-logL0
# ## End(Not run)
Run the code above in your browser using DataLab