Learn R Programming

CoSMoS (version 2.2.0)

generateMTSFast: Faster simulation of multiple time series 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

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
)

Value

A matrix of class c("matrix", "cosmosts") with attribute STmodel containing the fitted model components.

Arguments

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 c(-Inf, Inf))

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 ("affine" by default; "swirl" or "wave" also available)

anisotropyarg

list of arguments for anisotropyT; isotropic fields by default

dsid

dependence structure ID ("gauss" by default; "student", "bardossy", or "bardossyF")

dsarg

argument for the dependence structure: NULL for "gauss", degrees of freedom for "student", or parameter m in \((-\infty, \infty)\) for "bardossy"

Details

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.

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, 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, tools:::Rd_expr_doi("10.1029/2019WR026331")

See Also

generateMTS, generateRFFast, fitVAR

Examples

Run this code
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))
)

Run the code above in your browser using DataLab