# NOT RUN {
alcoff.e <- moffset(alcoff, "6", "Mon", postfix = "*") # Effective day
fit0 <- rcim(alcoff.e, family = poissonff)
# }
# NOT RUN {
par(oma = c(0, 0, 4, 0), mfrow = 1:2) # For all plots below too
ii <- plot(fit0, rcol = "blue", ccol = "orange",
lwd = 4, ylim = c(-2, 2), # A common ylim
cylab = "Effective daily effects", rylab = "Hourly effects",
rxlab = "Hour", cxlab = "Effective day")
ii@post # Endowed with additional information
# }
# NOT RUN {
# Negative binomial example
# }
# NOT RUN {
fit1 <- rcim(alcoff.e, negbinomial, trace = TRUE)
plot(fit1, ylim = c(-2, 2))
# }
# NOT RUN {
# Univariate normal example
fit2 <- rcim(alcoff.e, uninormal, trace = TRUE)
# }
# NOT RUN {
plot(fit2, ylim = c(-200, 400))
# }
# NOT RUN {
# Median-polish example
# }
# NOT RUN {
fit3 <- rcim(alcoff.e, alaplace1(tau = 0.5), maxit = 1000, trace = FALSE)
plot(fit3, ylim = c(-200, 250))
# }
# NOT RUN {
# Zero-inflated Poisson example on "crashp" (no 0s in alcoff)
# }
# NOT RUN {
cbind(rowSums(crashp)) # Easy to see the data
cbind(colSums(crashp)) # Easy to see the data
fit4 <- rcim(Rcim(crashp, rbaseline = "5", cbaseline = "Sun"),
zipoissonff, trace = TRUE)
plot(fit4, ylim = c(-3, 3))
# }
Run the code above in your browser using DataLab