| GeoSimCopula | R Documentation |
Simulation of Gaussian and some non-Gaussian univariate spatial and
spatio-temporal random fields using Gaussian, skew-Gaussian, Clayton-like or
AMH constructions. Bivariate correlation models are not supported.
The function returns a realization of a random field for a given covariance model and covariance parameters.
Exact simulation is available through Cholesky or SVD decomposition; for supported purely spatial correlation models, turning-bands simulation is available through method="TB".
GeoSimCopula(coordx=NULL, coordy=NULL,coordz=NULL, coordt=NULL,
coordx_dyn=NULL, corrmodel, distance="Eucl", grid=FALSE,
method="cholesky", model='Gaussian', n=1, param,
anisopars=NULL,radius=1, sparse=FALSE,
copula="Gaussian",X=NULL,spobj=NULL,nrep=1,progress=FALSE,check.duplicates=FALSE,
L=10000,parallel=FALSE,ncores=6)
coordx |
Optional when |
coordy |
A numeric vector giving 1-dimension of
spatial coordinates; Optional argument, the default is |
coordz |
A numeric vector giving 1-dimension of
spatial coordinates; Optional argument, the default is |
coordt |
A numeric vector giving the temporal coordinates at which the field is simulated. Optional argument; the default is |
coordx_dyn |
A list of |
corrmodel |
String; the name of a correlation model, for the
see |
distance |
String; the name of the spatial distance. The default
is |
grid |
Logical; if |
method |
String; simulation engine for the latent fields. Use |
model |
String; the type of RF and therefore the densities associated to the likelihood
objects. |
n |
Numeric; the number of trials for binomial random fields. The number of successes in the negative Binomial random fields. Default is |
param |
A list of parameter values required in the simulation procedure of random fields, see Examples. |
anisopars |
A list of two elements "angle" and "ratio" i.e. the anisotropy angle and the anisotropy ratio, respectively. |
radius |
Numeric; a value indicating the radius of the sphere when using the great circle distance. Default value is 1. |
sparse |
Logical; if |
copula |
String; one of |
X |
Numeric; Matrix of space-time covariates. |
spobj |
An object of class |
nrep |
Numeric; Numbers of indipendent replicates. |
progress |
Logic; If TRUE then a progress bar is shown. |
check.duplicates |
Logical. If |
L |
Positive integer; number of turning-band lines used when |
parallel |
Logical; default |
ncores |
Positive integer or |
Only univariate correlation models are accepted. Dynamic coordinates are
supported and the returned data preserve the list structure and row order of
coordx_dyn.
With method="TB", GeoSimCopula keeps the copula and marginal
construction unchanged but generates each required latent field through
GeoSimapprox(method="TB"). Consequently, TB is available only for
purely spatial models supported by the turning-bands backend, requires
distance="Eucl", and inherits the TB restrictions on correlation
families and coordinate dimension. The sparse argument is ignored by
the TB backend. Exact "cholesky" and "svd" simulations continue
to use GeoSim.
For the constructive Clayton-like simulator, param$nu must be a
positive integer and is never rounded silently. For copula="SkewGaussian",
param$nu is the bounded reflection-asymmetry parameter
\eta\in(-1,1) and is internally mapped to
\gamma_\eta=\eta/\sqrt{1-\eta^2}. The continuous margins audited
for copula simulation and pairwise copula fitting with the Gaussian,
Clayton-like and skew–Gaussian copulas are
Gaussian, StudentT, LogGaussian, Gamma,
Weibull, Beta, Beta2, Kumaraswamy,
Kumaraswamy2, Logistic, and SkewLaplace.
The Gaussian copula additionally has audited simulation and pairwise fitting for
Poisson, Binomial, and BinomialNeg. Exact conditional
simulation for these discrete copula margins is not currently implemented.
For model="StudentT",
param$df is the reciprocal degrees-of-freedom parameter: the Student-t
degrees of freedom are exactly 1/param$df, without integer rounding.
The same no-rounding convention is used for the Student-t degrees of freedom
of a "SkewStudentT" marginal. Because copula margins are obtained through
inverse CDFs, the integer latent-field restrictions used by direct GeoSim /
GeoSimapprox Gamma, Beta, and Student-t constructions do not apply here.
Gamma margins require a finite
positive shape and use shape shape/2 and scale
2/shape, hence the multiplicative factor has unit mean. With dynamic
coordinates, X may be a row-stacked matrix or a list of matrices aligned
with coordx_dyn. For SkewStudentT, skew is the native
\delta\in(-1,1) parameter and is converted to the skew-t shape
\alpha=\delta/\sqrt{1-\delta^2}. The Tukey-g-and-h implementation
uses its continuous limit when the skew parameter is zero. Kumaraswamy margins
use the inverse of the CDF employed by GeoPit.
Aliases accepted by the main modelling API, including Gauss,
SkewGauss, LogGauss, and TwoPieceGauss, are canonicalized
before the marginal transform. nrep must be a positive integer. For the AMH
construction, nu is checked to be a finite scalar; no additional theoretical
parameter range is imposed by this simulator. The returned param component is
the parameter list supplied by the user.
Binary and Bernoulli are aliases of Binomial with
n=1; Geom and Geometric are aliases of
BinomialNeg with n=1.
For univariate simulation, the marginal location is
\mu=X\beta, with coefficients named mean, mean1, and so
on in the order of the columns of X. If X=NULL, the model is
intercept-only. A vector param$mean supplies a known location value at
each observation and cannot be combined with X.
Returns an object of class GeoSimCopula.
An object of class GeoSimCopula is a list containing
at most the following components:
bivariate |
Always |
coordx |
A |
coordy |
A |
coordt |
A |
coordx_dyn |
A list of dynamical (in time) spatial coordinates; |
corrmodel |
The correlation model; see |
data |
The simulated data. Dynamic space-time output is a list with one vector per time, aligned with |
distance |
The type of spatial distance; |
method |
The method of simulation |
model |
The type of RF, see |
n |
The number of trial for Binomial random fields;the number of successes in a negative Binomial random fields; |
numcoord |
The number of spatial coordinates; |
numtime |
The number the temporal realisations of the RF; |
param |
A list of the parameters |
radius |
The radius of the sphere if coordinates are passed in lon/lat format; |
randseed |
The seed used for the random simulation; |
spacetime |
|
copula |
The type of copula |
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
Bevilacqua M., Alvarado E., Caamano C. (2024) A flexible Clayton-like spatial copula with application to bounded support data. Journal of Multivariate Analysis 201
library(GeoModels)
################################################################
###
### Example: Simulation of a reparametrized Beta RF
### for beta regression
### with Gaussian and Clayton Copula
### with underlying Wendland correlation.
###
###############################################################
set.seed(261)
NN=1400
x <- runif(NN);y <- runif(NN)
coords=cbind(x,y)
corrmodel="GenWend"
X=cbind(rep(1,NN),runif(NN))
NuisParam("Beta2",num_betas=2,copula="Gaussian")
CorrParam("GenWend")
#### Gaussian copula
param=list(smooth=0,power2=4, min=0,max=1,
mean=0.1,mean1=0.1,scale=0.3,nugget=0,shape=5)
data <- GeoSimCopula(coordx=coords, corrmodel=corrmodel, model="Beta2",param=param,
copula="Gaussian",sparse=TRUE,X=X)$data
if (requireNamespace("fields", quietly = TRUE)) fields::quilt.plot(coords,data)
#### Clayton copula
NuisParam("Beta2",num_betas=2,copula="Clayton")
CorrParam("GenWend")
param=list(smooth=0,power2=4, min=0,max=1,
mean=0.2,mean1=0.1,scale=0.3,nugget=0,shape=6,nu=4)
data1 <- GeoSimCopula(coordx=coords, corrmodel=corrmodel, model="Beta2",param=param,
copula="Clayton",sparse=TRUE,X=X)$data
hist(data1,freq=FALSE)
if (requireNamespace("fields", quietly = TRUE)) fields::quilt.plot(coords,data1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.