data(srft)
labels <- c("CMCG","ETA","GASP","GFS","JMA","NGPS","TCWB","UKMO")
srftData <- ensembleData( forecasts = srft[,labels],
dates = srft$date, observations = srft$obs,
latitude = srft$lat, longitude = srft$lon,
forecastHour = 48, initializationTime = "00")
if (FALSE) # R check
bmaFit <- ensembleBMA( srftData, date = "2004012900", trainingDays = 25,
model = "normal")
bmaForc <- quantileForecast( bmaFit, srftData, date = "2004012900",
quantiles = c(.1, .5, .9))
obs <- srftData$date == "2004012900"
lat <- srftData$latitude[obs]
lon <- srftData$longitude[obs]
plotProbcast( bmaForc[,"0.5"], lat, lon,
type = "contour", interpolate = TRUE)
title("Median Forecast")
plotProbcast( srftData$obs[obs], lat, lon,
type = "contour", interpolate = TRUE)
title("Observed Surface Temperature")
data(srftGrid)
memberLabels <- c("CMCG","ETA","GASP","GFS","JMA","NGPS","TCWB","UKMO")
srftGridData <- ensembleData(forecasts = srftGrid[,memberLabels],
latitude = srftGrid[,"latitude"], longitude = srftGrid[,"longitude"],
forecastHour = 48, initializationTime = "00")
gridForc <- quantileForecast( bmaFit, srftGridData,
date = "2004021400", quantiles = c( .1, .5, .9))
library(fields)
plotProbcast(gridForc[,"0.5"],lon=srftGridData$lon,
lat=srftGridData$lat,type="image",col=rev(rainbow(100,start=0,end=0.85)))
title("Median Grid Forecast for Surface Temperature", cex = 0.5)
probFreeze <- cdf( bmaFit, srftGridData, date = "2004021400",
value = 273.15)
plotProbcast(probFreeze, lon=srftGridData$lon, lat=srftGridData$lat,
type="image",col=gray((32:0)/32))
title("Probability of Freezing", cex = 0.5)
Run the code above in your browser using DataLab