# Load FieldSim library
library(FieldSim)
d<-function(x){ #Distance on the hyperbolo�d
u <- -x[1]*x[4]-x[2]*x[5]+x[3]*x[6]
if (u<1){u<-1}
acosh(u)
}
#Example 1: Hyperbolo�d indexed Brownian fractional Field with RH1 covariance function
RH1<-function(x){
H<-0.45 # H can vary from 0 to 0.5
1/2*(d(c(0,0,1,x[1:3]))^{2*H}+d(c(0,0,1,x[4:6]))^{2*H}-d(x)^{2*H})
}
resh1<- hypersim(RH1,Ne=100,Nr=1000,Ng=50,nbNeighbor=4)
library(rgl)
library(RColorBrewer)
printhyper(resh1)
#Example 2: Hyperbolo�d indexed Brownian Field with RH4 covariance function
RH4<-function(x){
H<-0.45
1/(1+d(x)^{2*H})
}
resh4<- hypersim(RH4,Ne=100,Nr=1000,Ng=50,nbNeighbor=4)
printhyper(resh4)
Run the code above in your browser using DataLab