generateRFFast {CoSMoS} | R Documentation |
Faster simulation of random fields with approximately separable spatiotemporal correlation structure
Description
For more details see section 6 in Serinaldi and Kilsby (2018), and section 2.4 in Papalexiou and Serinaldi (2020).
Usage
generateRFFast(
n,
spacepoints,
margdist,
margarg,
p0,
distbounds = c(-Inf, Inf),
stcsid,
stcsarg,
scalefactor = 1,
anisotropyid = "affine",
anisotropyarg = list(phi1 = 1, phi2 = 1, phi12 = 0, theta = 0)
)
Arguments
n |
number of fields (time steps) to simulate |
spacepoints |
side length m of the square field |
margdist |
target marginal distribution of the field |
margarg |
list of marginal distribution arguments. Please consult the documentation of the selected marginal distribution indicated in the argument |
p0 |
probability zero |
distbounds |
distribution bounds (default set to |
stcsid |
spatiotemporal correlation structure ID |
stcsarg |
list of spatiotemporal correlation structure arguments. Please consult the documentation of the selected spatiotemporal correlation structure indicated in the argument |
scalefactor |
factor specifying the distance between the centers of two pixels (default set to 1) |
anisotropyid |
spatial anisotropy ID ( |
anisotropyarg |
list of arguments characterizing the spatial anisotropy according to the syntax of the function |
Details
generateRFFast
provides a faster approach to RF simulation
compared to generateRF
by exploiting circulant embedding
fast Fourier transformation.
However, this approach is feasible only for approximately
separable target spatiotemporal correlation functions.
generateRFFast
comprises fitting and simulation in a single function.
Here, we give indicative CPU times for some settings, referring to a
Windows 10 Pro x64 laptop with Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz,
4-core, 8 logical processors, and 32GB RAM.
CPU time:
m = 50, n = 1000: ~58s
m = 50, n = 10000: ~160s
m = 100, n = 1000: ~2955s (~50min)
References
Serinaldi, F., Kilsby, C.G. (2018). Unsurprising Surprises: The Frequency of Record-breaking and Overthreshold Hydrological Extremes Under Spatial and Temporal Dependence. Water Resources Research, 54(9), 6460-6487, doi: 10.1029/2018WR023055
Papalexiou, S.M., Serinaldi, F. (2020). Random Fields Simplified: Preserving Marginal Distributions, Correlations, and Intermittency, With Applications From Rainfall to Humidity. Water Resources Research, 56(2), e2019WR026331, doi: 10.1029/2019WR026331
Examples
sim <- generateRFFast(
n = 50,
spacepoints = 3,
p0 = 0.7,
margdist ='paretoII',
margarg = list(scale = 1,
shape = .3),
stcsarg = list(scfid = "weibull",
tcfid = "weibull",
scfarg = list(scale = 20,
shape = 0.7),
tcfarg = list(scale = 1.1,
shape = 0.8))
)
checkRF(sim,
lags = 10,
nfields = 49)