| GeoSimCopula {GeoModels} | R Documentation | 
Simulation of Gaussian and non Gaussian Random Fields using copula.
Description
Simulation of Gaussian and some non Gaussian spatial, spatio-temporal and spatial bivariate random fields using Gaussian or Clayton copula. The function return a realization of a Random Field for a given covariance model and covariance parameters. Simulation is based on Cholesky decomposition.
Usage
GeoSimCopula(coordx, coordy=NULL, coordt=NULL, 
coordx_dyn=NULL, corrmodel, distance="Eucl",
      GPU=NULL, grid=FALSE, local=c(1,1),
      method="cholesky", model='Gaussian', n=1, param,
      anisopars=NULL,radius=6371, sparse=FALSE,
      copula="Gaussian",seed=NULL, X=NULL,spobj=NULL,nrep=1)
Arguments
coordx | 
 A numeric (  | 
coordy | 
 A numeric vector giving 1-dimension of
spatial coordinates;   | 
coordt | 
 A numeric vector giving 1-dimension of
temporal coordinates.  Optional argument, the default is   | 
coordx_dyn | 
 A list of   | 
corrmodel | 
 String; the name of a correlation model, for the description see the Section Details.  | 
distance | 
 String; the name of the spatial distance. The default
is   | 
GPU | 
 Numeric; if   | 
grid | 
 Logical; if   | 
local | 
 Numeric; number of local work-items of the GPU  | 
method | 
 String; the type of matrix decomposition used in the simulation. Default is cholesky. The other possible choices is   | 
model | 
 String; the type of RF and therefore the densities associated to the likelihood
objects.   | 
n | 
 Numeric; the number of trials for binomial RFs. The number of successes in the negative Binomial RFs. Default is   | 
param | 
 A list of parameter values required in the simulation procedure of RFs, 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 the radius of the earth in Km (i.e. 6371)  | 
sparse | 
 Logical; if   | 
copula | 
 String; the type of copula. It can be "Clayton" or "Gaussian"  | 
seed | 
 Numeric; an integer used in set.seed function to reproduce the simulation.  | 
X | 
 Numeric; Matrix of space-time covariates.  | 
spobj | 
 An object of class sp or spacetime  | 
nrep | 
 Numeric; Numbers of indipendent replicates.  | 
Value
Returns an object of class GeoSimCopula.
An object of class GeoSimCopula is a list containing
at most the following components:
bivariate | 
 Logical:  | 
coordx | 
 A   | 
coordy | 
 A   | 
coordt | 
 A   | 
coordx_dyn | 
 A list of dynamical (in time) spatial coordinates;  | 
corrmodel | 
 The correlation model; see   | 
data | 
 The vector or matrix or array of data, see
  | 
distance | 
 The type of spatial distance;  | 
method | 
 The method of simulation  | 
model | 
 The type of RF, see   | 
n | 
 The number of trial for Binomial RFs;the number of successes in a negative Binomial RFs;  | 
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  | 
Author(s)
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
Examples
library(GeoModels)
################################################################
###
### Example q. 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)
shape1=3
shape2=3
smooth=0
corrmodel="GenWend"
min=0;max=1
X=cbind(rep(1,NN),runif(NN))
NuisParam("Beta2",num_betas=2,copula="Gaussian")
CorrParam("GenWend")
#### Gaussian copula
param=list(smooth=smooth,power2=4, min=min,max=max,
             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
quilt.plot(coords,data)
#### Clayton copula
NuisParam("Beta2",num_betas=2,copula="Clayton")
CorrParam("GenWend")
param=list(smooth=smooth,power2=4, min=min,max=max,
             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)
quilt.plot(coords,data1)