Learn R Programming

CoSMoS (version 2.2.0)

generateRFFast: 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),
  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 fields (time steps) to simulate

spacepoints

side length m of the square field (m x m)

margdist

target marginal distribution of the field

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

generateRFFast provides faster RF simulation than generateRF by exploiting circulant-embedding fast Fourier transformation. This approach is feasible only for approximately separable target spatiotemporal correlation functions. generateRFFast combines fitting and simulation in a single call. Indicative CPU times (Windows 10 Pro x64, Intel Core i7-6700HQ, 32 GB RAM):
m = 50, n = 1000: ~58s
m = 50, n = 10000: ~160s
m = 100, n = 1000: ~2955s (~50 min)

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

generateRF, generateMTSFast, checkRF, fitVAR

Examples

Run this code

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)

Run the code above in your browser using DataLab