Learn R Programming

CoSMoS (version 2.2.0)

actpnts: AutoCorrelation Transformed Points

Description

Evaluates the (rho_x, rho_z) mapping between the target marginal autocorrelation and the underlying Gaussian autocorrelation, using a double numerical integral.

Usage

actpnts(margdist, margarg, p0 = 0, distbounds = c(-Inf, Inf))

Value

A data frame with columns rhoz (Gaussian correlations) and rhox (corresponding target marginal correlations).

Arguments

margdist

target marginal distribution

margarg

list of marginal distribution arguments

p0

probability zero

distbounds

numeric vector of length 2; distribution bounds (default c(-Inf, Inf))

Details

When the package is compiled with Rcpp support (i.e., actpnts_cpp is available), the double integral is evaluated in C++ via the Cubature algorithm, which is substantially faster than the nested base-R integrate() fallback. The C++ path supports the following distributions natively: ggamma, paretoII, burrXII, burrIII, gev, norm, beta, gamma, exp, weibull, lnorm, unif. Any other distribution falls back to the R quantile function automatically, so correctness is always preserved.

References

Papalexiou, S.M. (2018). Unified theory for stochastic modelling of hydroclimatic processes: Preserving marginal distributions, correlation structures, and intermittency. Advances in Water Resources, 115, 234-252, tools:::Rd_expr_doi("10.1016/j.advwatres.2018.02.013")

See Also

fitactf, acti, generateTS

Examples

Run this code

library(CoSMoS)

## Pareto type II marginal
x <- actpnts(margdist = "paretoII",
             margarg  = list(scale = 1, shape = .3),
             p0 = 0)
x

Run the code above in your browser using DataLab