simGwexModel: simGwexModel

Description Usage Arguments Value Author(s) Examples

View source: R/GWex_lib.r

Description

Simulate from a GWex model

Usage

1
2
3
4
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)

Arguments

objGwexFit

an object of class GwexFit

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 GwexObs if we need the observations to simulate (disaggregation prec 3D -> 1D)

prob.class

vector of probabilities indicating class of "similar" mean intensities

objGwexSim

optional: an object of class GwexSim if we need simulations to simulate (temp conditional to prec)

nCluster

optional, number of clusters which can be used for the parallel computation

Value

GwexSim

an object of class GwexSim. Contains sim (3D-array with the simulations) and a vector of dates

Author(s)

Guillaume Evin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 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:2])

# default options except for 'nChainFit'
list.options = list(nChainFit=1000)

# generate 2 scenarios for one year, using a existing 'GwexFit' object
mySimPrec = simGwexModel(objGwexFit=myParPrecGWEX, nb.rep=2, d.start=vecDates[1],
d.end=vecDates[365])
mySimPrec # print object

###############################################################
#     FIT AND SIMULATE FROM THE TEMPERATURE MODEL, COND. TO PRECIPITATION
###############################################################
# Format observations: create a G-Wex object
myObsTemp = GwexObs(variable='Temp',date=vecDates,obs=dailyTemperGWEX)

# generate 2 scenarios for one year, using a existing 'GwexFit' object
mySimTemp = simGwexModel(objGwexFit=myParTempGWEX, nb.rep=2, d.start=vecDates[1], 
d.end=vecDates[365])
mySimTemp # print object

GWEX documentation built on Dec. 9, 2019, 5:08 p.m.