startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- LoadSampleData(startDates,
leadtimemin = 1,
leadtimemax = 4,
output = 'lonlat')
ano <- Ano_CrossValid(sampleData$mod, sampleData$obs)
eof_exp <- EOF(ano$exp, sampleData$lat, sampleData$lon, neofs = 5)
eof_obs <- EOF(ano$obs, sampleData$lat, sampleData$lon, neofs = 5)
mode1_exp <- ProjectField(ano$exp, eof_exp, mode = 1)
mode1_obs <- ProjectField(ano$obs, eof_obs, mode = 1)
# \donttest{
# Plot the forecast and the observation of the first mode for the last year
# of forecast
sdate_dim_length <- dim(mode1_obs)['sdate']
plot(mode1_obs[sdate_dim_length, 1, 1, ], type = "l", ylim = c(-1, 1),
lwd = 2)
for (i in 1:dim(mode1_exp)['member']) {
par(new = TRUE)
plot(mode1_exp[sdate_dim_length, 1, i, ], type = "l", col = rainbow(10)[i],
ylim = c(-15000, 15000))
}
# }
Run the code above in your browser using DataLab