# NOT RUN {
##Create a new data that contains climatic series and all effects that will be
##used as covariates for the variable to be projected or simulated
temp.effects <- seasonal.effect(myclimatic_data, period=c(365,183))
temp.effects <- diurnal.effect(temp.effects, period=24)
temp.effects <- spatave.effect(temp.effects, "temp", nstat = 3, na.proc = TRUE)
temp.effects <- lagged.effect(temp.effects, "temp",2, nstat=3)
temp.effects$t2m <- rnorm(length(myclimatic_data),mean=25,sd=1)
coord <- data.frame(x=c(9.92,9.93,10.04),y=c(35.55,35.62,35.57))
nstat=3
init.buff=48*7 ##48 time step per day and 7 days will be considered as buffer time
dstart=as.numeric(mycovariates[(init.buff*nstat)+1,1])
dend=as.numeric(mycovariates$dates[nrow(mycovariates)])
##fitted variable
temp.fitted <- fit.glm("temp", dep.var = NULL, geocov=TRUE, large.var="t2m",
seasonal = TRUE, speriod = c(365, 183), diurnal = TRUE, dperiod = 24,
spatave = FALSE, movave = FALSE, spatmovave= FALSE, lagvar=2, add.cov = FALSE,
others = NULL, fam.glm = "gaussian", data= temp.effects)
temp.projection <- projection.lagged(dstart, dend, temp.fitted, "temp", maxlag=2,
coord, cov=mycovariates, seasonal = TRUE, speriod = c(365,183), diurnal = TRUE,
dperiod = 24, spatave = FALSE, movave=FALSE,bw = 0, fam.glm = "gaussian",
occ.cond = NULL)
##Remove buffer
temp.projection <- rm.buffer(temp.projection, nstat, bi.length=init.buff)
# }
Run the code above in your browser using DataLab