gamsv | R Documentation |
Calculates the Fouedijo et al. (2015) theoretical semivariogram. This is a function of some central
location o= centre
and distance between locations s1
and s2
.
The semivariogram. has the form
γ^*(s_2,s_1)=γ(||ψ(s_2)-ψ(s_1)||),
where
ψ(s)=o+(s-o)||s-o||
and
γ(x)=(x/λ)^κ
for λ > 0 and κ \in (0,2].
gamsv(s1, s2, centre = NULL, lam, kap)
s1 |
Vector of length 2 giving coordinates of first location. |
s2 |
Vector of length 2 giving coordinates of second location. |
centre |
Vector of length 2 giving coordinates of centre of non-stationarity. If |
lam |
Value of λ. |
kap |
Value of κ. |
Non-stationary semivariogram. between locations s1
and s2
Fouedijo et al. (2015) Spatial Statistics, 13:45-61, (doi)
##Creating correlation values to simulate non-stationary Brown-Resnick process. See help(brnsims). lambda<-2 centre<-c(0,0) kappa<-0.8 n.grid<-8 sim.coords<-as.matrix(expand.grid(seq(-1,1,length=n.grid),seq(-1,1,length=n.grid))) p<-dim(sim.coords)[1] tau<-matrix(NA,nrow=p,ncol=p) for(i in 1:p){ for(j in 1:p){ tau[i,j]<-gamsv(s1=sim.coords[i,],s2=c(0,0),lam=lambda,kap=kappa,centre=NULL)+ gamsv(s1=sim.coords[j,],s2=c(0,0),lam=lambda,kap=kappa,centre=NULL)- gamsv(s1=sim.coords[i,],s2=sim.coords[j,],lam=lambda,kap=kappa,centre=centre) } } ##Simulates 10 realisations of non-stationary BR process. Sim<-brnsims(reps=10,locs=sim.coords,kappa=kappa,lambda=lambda,centre=centre,tau=tau)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.