brnsims | R Documentation |
Simulate a non-stationary (or stationary) Brown-Resnick process using the 'stopping rule'
methodology of Dieker and Mikosch (2015). Non-stationary Brown-Resnick processes are simulated
using the non-stationary semivariogram. detailed in the help file for gamsv
.
brnsims(reps, locs, kappa, lambda, tau, centre = NULL)
reps |
Number of realisations, n. |
locs |
A p by 2 matrix of coordinates. |
kappa |
Value of κ. See |
lambda |
Value of λ. See |
tau |
A p by p matrix of correlation values. |
centre |
Vector of length 2 giving coordinates of centre of non-stationarity for semivariogram. If |
n by p matrix
Dieker and Mikosch (2015) Extremes, 18(2):301-314, (doi)
##Creating correlation values to simulate non-stationary Brown-Resnick process. 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.