View source: R/generate-fields.R
| generateMTSFast | R Documentation |
For more details see section 6 in Serinaldi and Kilsby (2018) and section 2.4 in Papalexiou and Serinaldi (2020).
generateMTSFast(
n,
spacepoints,
margdist,
margarg,
p0,
distbounds = c(-Inf, Inf),
stcsarg,
scalefactor = 1,
anisotropyid = "affine",
anisotropyarg = list(phi1 = 1, phi2 = 1, phi12 = 0, theta = 0),
dsid = "gauss",
dsarg = NULL
)
n |
number of time steps to simulate |
spacepoints |
matrix (d x 2) of coordinates (e.g. longitude and latitude) for d spatial locations (e.g. gauge stations) |
margdist |
target marginal distribution |
margarg |
list of marginal distribution arguments; consult the documentation of the selected distribution for the required parameters |
p0 |
probability zero |
distbounds |
distribution bounds (default |
stcsarg |
list of spatiotemporal correlation structure arguments; consult the documentation of the selected structure for required parameters |
scalefactor |
factor specifying the distance between pixel centres (default 1) |
anisotropyid |
spatial anisotropy ID ( |
anisotropyarg |
list of arguments for |
dsid |
dependence structure ID ( |
dsarg |
argument for the dependence structure: |
generateMTSFast provides faster multivariate simulation than
generateMTS by exploiting circulant-embedding fast Fourier
transformation. This approach is feasible only for approximately separable
target spatiotemporal correlation functions.
generateMTSFast combines fitting and simulation in a single call.
Indicative CPU times (Windows 10 Pro x64, Intel Core i7-6700HQ, 32 GB RAM):
d = 2500, n = 1000: ~58s
d = 2500, n = 10000: ~160s
d = 10000, n = 1000: ~2955s (~50 min)
where d denotes the number of spatial locations.
A matrix of class c("matrix", "cosmosts") with attribute
STmodel containing the fitted model components.
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, \Sexpr[results=rd]{tools:::Rd_expr_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, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1029/2019WR026331")}
generateMTS, generateRFFast,
fitVAR
coord <- cbind(runif(4) * 30, runif(4) * 30)
sim <- generateMTSFast(
n = 50,
spacepoints = coord,
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))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.