##
###########################
## The GP models:
###########################
##
## Foreecasts: GP models
##
# define forecast coordinates and variables
# forecast in the validation sites (hold-out sites)
fore.coords<-as.matrix(val.site[,2:3])
# one-step ahead forecast, i.e., in day 62
fore.gp <- spT.forecast(nBurn=100, K=1, fore.data=val.fore,
fore.coords=fore.coords, posteriors=post.gp, Summary=TRUE)
names(fore.gp)
# forecast validations for the validation sites
spT.validation(val.fore$o8hrmax,c(fore.gp$Mean)) #
spT.pCOVER(val.fore$o8hrmax,c(fore.gp$Up),c(fore.gp$Low)) #
spT.segment.plot(val.fore$o8hrmax,c(fore.gp$Mean),
c(fore.gp$Up),c(fore.gp$Low))
abline(a=0,b=1)
# forecast in the fitted sites
fore.coords<-as.matrix(fit.site[,2:3])
fore.gp <- spT.forecast(nBurn=100, K=1, fore.data=fit.fore,
fore.coords=fore.coords, posteriors=post.gp, Summary=TRUE)
names(fore.gp)
# forecast validations for the fitted sites
spT.validation(fit.fore$o8hrmax,c(fore.gp$Mean)) #
spT.pCOVER(fit.fore$o8hrmax,c(fore.gp$Up),c(fore.gp$Low)) #
spT.segment.plot(fit.fore$o8hrmax,c(fore.gp$Mean),
c(fore.gp$Up),c(fore.gp$Low))
abline(a=0,b=1)
###########################
## The AR models:
###########################
##
## Forecasts: AR models
##
# define forecast coordinates and variables
# forecast in the validation sites (hold-out sites)
fore.coords<-as.matrix(val.site[,2:3])
# one-step ahead forecast, i.e., in day 62
fore.ar <- spT.forecast(nBurn=100, K=1, fore.data=val.fore,
fore.coords, pred.samples.ar=pred.ar,
posteriors=post.ar, Summary=TRUE)
names(fore.ar)
# forecast validations for the validation sites
spT.validation(val.fore$o8hrmax,c(fore.ar$Mean)) #
spT.pCOVER(val.fore$o8hrmax,c(fore.ar$Up),c(fore.ar$Low)) #
spT.segment.plot(val.fore$o8hrmax,c(fore.ar$Mean),
c(fore.ar$Up),c(fore.ar$Low))
abline(a=0,b=1)
# forecast in the fitted sites
fore.coords<-as.matrix(fit.site[,2:3])
fore.ar <- spT.forecast(nBurn=100, K=1, fore.data=fit.fore,
fore.coords, pred.samples.ar=NULL,
posteriors=post.ar, Summary=TRUE)
names(fore.ar)
# forecast validations for the fitted sites
spT.validation(fit.fore$o8hrmax,c(fore.ar$Mean)) #
spT.pCOVER(fit.fore$o8hrmax,c(fore.ar$Up),c(fore.ar$Low)) #
spT.segment.plot(fit.fore$o8hrmax,c(fore.ar$Mean),
c(fore.ar$Up),c(fore.ar$Low))
abline(a=0,b=1)
###########################
## Models with GPP approximations:
###########################
##
## Forecasts: GPP based models
##
# define forecast coordinates and variables
# forecast in the validation sites (hold-out sites)
fore.coords<-as.matrix(val.site[,2:3])
# one-step ahead forecast, i.e., in day 62
fore.gpp <- spT.forecast(nBurn=100, K=1, fore.data=val.fore,
fore.coords=fore.coords, posteriors=post.gpp,
Summary=TRUE)
names(fore.gpp)
# forecast validations for the validation sites
spT.validation(val.fore$o8hrmax,c(fore.gpp$Mean)) #
spT.pCOVER(val.fore$o8hrmax,c(fore.gpp$Up),c(fore.gpp$Low)) #
spT.segment.plot(val.fore$o8hrmax,c(fore.gpp$Mean),
c(fore.gpp$Up),c(fore.gpp$Low))
abline(a=0,b=1)
# forecast in the fitted sites
forecast.coords<-as.matrix(fit.site[,2:3])
fore.gpp <- spT.forecast(nBurn=100, K=1, fore.data=fit.fore,
fore.coords=forecast.coords, posteriors=post.gpp,
Summary=TRUE)
names(fore.gpp)
# forecast validations for the fitted sites
spT.validation(fit.fore$o8hrmax,c(fore.gpp$Mean)) #
spT.pCOVER(fit.fore$o8hrmax,c(fore.gpp$Up),c(fore.gpp$Low)) #
spT.segment.plot(fit.fore$o8hrmax,c(fore.gpp$Mean),
c(fore.gpp$Up),c(fore.gpp$Low))
abline(a=0,b=1)
##
Run the code above in your browser using DataLab