| simGwexModel | R Documentation | 
Simulate from a GWex model
simGwexModel(
  objGwexFit,
  nb.rep = 10,
  d.start = as.Date("01011900", "%d%m%Y"),
  d.end = as.Date("31121999", "%d%m%Y"),
  objGwexObs = NULL,
  prob.class = c(0.5, 0.75, 0.9, 0.99),
  objGwexSim = NULL,
  nCluster = 1
)
| objGwexFit | an object of class  | 
| nb.rep | number of repetitions of scenarios | 
| d.start | a starting date for the simulation | 
| d.end | an ending date for the simulation | 
| objGwexObs | optional: an object of class  | 
| prob.class | vector of probabilities indicating class of "similar" mean intensities | 
| objGwexSim | optional: an object of class  | 
| nCluster | optional, number of clusters which can be used for the parallel computation | 
| GwexSim | an object of class  | 
Guillaume Evin
# vector of dates
vecDates = seq(from=as.Date("01/01/2005",format="%d/%m/%Y"),
to=as.Date("31/12/2014",format="%d/%m/%Y"),by='day')
###############################################################
#               FIT AND SIMULATE FROM THE PRECIPITATION MODEL
###############################################################
# Format observations: create a G-Wex object
myObsPrec = GwexObs(variable='Prec',date=vecDates,obs=dailyPrecipGWEX[,1,drop=FALSE])
# Fit GWEX precipitation model, default options except for the threshold th
myParPrec = fitGwexModel(myObsPrec,listOption=list(th=0.5)) # fit model
# Generate 2 scenarios for one year, using the 'GwexFit' object
mySimPrec = simGwexModel(objGwexFit=myParPrec, nb.rep=2, d.start=vecDates[1],
d.end=vecDates[10])
mySimPrec # print object
###############################################################
#     FIT AND SIMULATE FROM THE TEMPERATURE MODEL
###############################################################
# Format observations: create a G-Wex object
myObsTemp = GwexObs(variable='Temp',date=vecDates,obs=dailyTemperGWEX)
# Fit GWEX temperature model
myParTemp = fitGwexModel(myObsTemp,listOption=list(hasTrend=TRUE,typeMargin='Gaussian',
depStation='Gaussian'))
# Generate 2 scenarios for one year, using an existing 'GwexFit' object
mySimTemp = simGwexModel(objGwexFit=myParTemp, nb.rep=2, d.start=vecDates[1], 
                          d.end=vecDates[365],objGwexObs=myObsPrec)
mySimTemp # print object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.