runACF | R Documentation |
run functions to create acf matrix and plot the results
runACF(
block,
model,
store = FALSE,
save = F,
suppress.printout = TRUE,
maxlag = NULL,
printplot = TRUE
)
block |
Vector of blocks that identify data points that are correlated |
model |
Fitted model object (glm or gam) |
store |
( |
save |
( |
suppress.printout |
( |
maxlag |
( |
Plot of lag vs correlation. Each grey line is the correlation for each individual block in block
. The red line is the mean values for each lag.
If store=TRUE
then the matrix of correlations (nblocks x length_max_block) is returned and plotacf
may be used to plot the acf.
LAS Scott-Hayward, University of St Andrews
# load data
data(ns.data.re)
model<-gamMRSea(birds ~ observationhour + as.factor(floodebb) + as.factor(impact),
family='quasipoisson', data=ns.data.re)
ns.data.re$blockid<-paste(ns.data.re$GridCode, ns.data.re$Year, ns.data.re$MonthOfYear,
ns.data.re$DayOfMonth, sep='')
ns.data.re$blockid<-as.factor(ns.data.re$blockid)
runACF(ns.data.re$blockid, model, suppress.printout=TRUE)
# storing the output and then plotting
acfoutput <- runACF(ns.data.re$blockid, model, suppress.printout=TRUE, store=TRUE)
plotacf(acfoutput$acfmat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.