library(GeoModels)
################################################################
###
### Example 1. Correlation of a (mean reparametrized) beta random field with underlying
### Matern correlation model using Gaussian and Clayton copulas
###
###############################################################
# Define the spatial distances
x = seq(0,0.4,0.01)
# Correlation Parameters for Matern model
CorrParam("Matern")
NuisParam("Beta2")
# corr Gaussian copula
param=list(smooth=0.5,sill=1,scale=0.2/3,nugget=0,mean=0,min=0,max=1,shape=0.5)
corr1= GeoCorrFct_Cop(x=x, corrmodel="Matern", param=param,copula="Gaussian",model="Beta2")
plot(corr1,ylab="corr",main="Gauss copula correlation",lwd=2)
# corr Clayton copula
param=list(smooth=0.5,sill=1,scale=0.2/3,nugget=0,mean=0,min=0,max=1,shape=0.5,nu=2)
corr2= GeoCorrFct_Cop(x=x, corrmodel="Matern", param=param,copula="Clayton",model="Beta2")
lines(x,corr2$corr,ylim=c(0,1),lty=2)
plot(corr1,ylab="corr",main="Clayton copula correlation",lwd=2)
Run the code above in your browser using DataLab