R/ComprehensiveTemperatureGenerator.R
ComprehensiveTemperatureGenerator.Rd
The Comprehensive Temperature Generator
ComprehensiveTemperatureGenerator(
station = c("T0001", "T0010", "T0099"),
Tx_all,
Tn_all,
mean_climate_Tn = NULL,
mean_climate_Tx = NULL,
Tx_spline = NULL,
Tn_spline = NULL,
year_max = 1990,
year_min = 1961,
leap = TRUE,
nmonth = 12,
verbose = TRUE,
p = 1,
type = "none",
lag.max = NULL,
ic = "AIC",
activateVARselect = FALSE,
year_max_sim = year_max,
year_min_sim = year_min,
mean_climate_Tn_sim = NULL,
mean_climate_Tx_sim = NULL,
Tn_spline_sim = NULL,
Tx_spline_sim = NULL,
onlygeneration = FALSE,
varmodel = NULL,
normalize = TRUE,
type_quantile = 3,
sample = NULL,
extremes = TRUE,
option = 2,
yearly = FALSE,
yearly_sim = yearly,
n_GPCA_iteration = 0,
n_GPCA_iteration_residuals = n_GPCA_iteration,
exogen = NULL,
exogen_sim = exogen,
is_exogen_gaussian = FALSE,
exogen_all = NULL,
exogen_all_col = station,
nscenario = 1,
seed = NULL,
noise = NULL
)
see respective input parameter on setComprehensiveTemperatureGeneratorParameters
see respective input parameter on setComprehensiveTemperatureGeneratorParameters
see respective input parameter on setComprehensiveTemperatureGeneratorParameters
see respective input parameter on getVARmodel
last year of the simulation period. Default is equal to year_max
first year of the simulation period. Default is equal to year_min
monthly averaged daily minimum temperatures for the simulated scenario and used by the random generator . Default is mean_climate_Tn
monthly averaged daily maximum temperatures for the simulated scenario and used by the random generator . Default is mean_climate_Tx
daily timeseries (from the first day of year_min_sim
to the last day of year_max_sim
) of averaged minimum temperature which can be obtained by a spline interpolation of monthly mean values (for the generation period). Default is Tn_spline
. See for spline interpolation utilized splineInterpolateMonthlytoDailyforSeveralYears
.
daily timeseries (from the first day of year_min_sim
to the last day of year_max_sim
) of averaged maximum temperature which can be obtained by a spline interpolation of monthly mean values (for the generation period). Default is Tx_spline
. See for spline interpolation utilized splineInterpolateMonthlytoDailyforSeveralYears
.
logical variable. If TRUE
the VAR model varmodel
is given as input and only random generation is done, otherwise (default) is calculated from measured data
the comprehensinve VAR model as a varest2
or GPCAvarest2
S4 object or a NULL
object. If NULL
(default), the comprehensinve VAR is estimated from measured data within the function, otherwise it is given as input and only random generation is done.
see normalizeGaussian_severalstations
or setComprehensiveTemperatureGeneratorParameters
see type
on quantile
integer value. If 1, the generator works with minimun and maximum temperature, if 2 (default) it works with the average value between maximum and minimum temparature and the respective daily thermal range.
logical value. If TRUE
the monthly mean values are calculated for each year from year_min
to year_max
separately. Default is FALSE
.
logical value. If TRUE
the monthly mean values are calculated for each year from year_min_sim
to year_max_sim
separately. Default is yearly
.
number of iterations of Gaussianization process for data. Default is 0 (no Gaussianization)
number of iterations of Gaussianization process for VAR residuals. Default is 0 (no Gaussianization)
data frame or matrix containing the (normalized or not) exogenous variables (predictors) for the recorded (calibration) period. Default is NULL
.
data frame or matrix containing the (normalized or not) exogenous variables (predictors) for the simulation period. Default is NULL
. If it is NULL
, exogen_sim
is set equal to exogen
within the function.
logical value, If TRUE
, exogen_sim
and exogen
are given as already normalized variables, otherwhise they are not normalized. Default is FALSE
data frame containing exogenous variable formatted like Tx_all
and Tn_all
. Default is NULL
.
It is alternative to exogen
and if it not NULL
,is_exogen_gaussian
is automatically set to FALSE
vector of considered columns of exogen_all
. Default is station
.
number of generated scenarios for daily maximum and minimum temperature
seed for stochastic random generation see set.seed
stochastic noise to add for variabile generation. Default is NULL
. See newVARmultieventRealization
. Not used in case that nscenario>1
.
A list of the following variables:
input
list of variables returned by setComprehensiveTemperatureGeneratorParameters
var
varest object containing the used VAR model (if useVAR is true), NULL
(otherwise)
output
list variables returned by generateTemperatureTimeseries
(i.e. generated timeseries)
It pre-processes series and generates multi-site temperature fields by using setComprehensiveTemperatureGeneratorParameters
,getVARmodel
and generateTemperatureTimeseries
. Detailed examples can be viewed of this function in this presentation.
data(trentino)
set.seed(1222) # set the seed for random generations!
year_min <- 1961
year_max <- 1990
year_min_sim <- 1982
year_max_sim <- 1983
n_GPCA_iter <- 5
n_GPCA_iteration_residuals <- 5
p <- 1
vstation <- c("B2440","B6130","B8570","B9100","LAVIO","POLSA","SMICH","T0001",
"T0010","T0014","T0018","T0032","T0064","T0083","T0090","T0092",
"T0094","T0099","T0102","T0110","T0129","T0139","T0147","T0149",
"T0152","T0157","T0168","T0179","T0189","T0193","T0204","T0210",
"T0211","T0327","T0367","T0373")
## Not Run: the call to ComprehensiveTemperatureGenerator may elapse
## too long time (more than 5 eseconds) and is not executed by CRAN check.
## Please uncomment the following line to run the example on your own PC.
# generation00 <-ComprehensiveTemperatureGenerator(station=vstation[16],
# Tx_all=TEMPERATURE_MAX,Tn_all=TEMPERATURE_MIN,year_min=year_min,year_max=year_max,
# p=p,n_GPCA_iteration=n_GPCA_iter,n_GPCA_iteration_residuals=n_GPCA_iteration_residuals,
# sample="monthly",year_min_sim=year_min_sim,year_max_sim=year_max_sim)