fieldsim {FieldSim} | R Documentation |
The function fieldsim
yields discretization of sample path of a Gaussian field following the
procedure described in Brouste et al. (2007).
fieldsim(S,Elevel=1,Rlevel=5,nbNeighbor=4)
S |
a covariance function (defined on [0,1]^4) of a Random field to simulate. |
Elevel |
a positive integer. Elevel is the
level associated with the regular space discretization for the first
step of the algorithm (Accurate simulation step). The
regular space discretization is of the following form:
[[0:2^{Elevel }]/2^{Elevel }]^2. |
Rlevel |
a positive integer. Elevel +Rlevel is the
level associated with the regular space discretization for the second
step of the algorithm (Refined simulation step). The
regular space discretization is of the following form:
[[0:2^{Elevel +Rlevel }]/2^{Elevel +Rlevel }]^2. |
nbNeighbor |
a positive integer. nbNeighbor must be between 1 and 32.
nbNeighbor is the number of neighbors to use in the second step
of the algorithm. |
The function fieldsim
yields discretization of sample path of a Gaussian field
associated with the covariance function given by R
.
The subspace [0,1]x[0,1] is discretized in a regular space discretization of size
(2^{Elevel
+Rlevel
}+1)^2. At each point of the grid, the Gaussian field is simulated using the
procedure described in Brouste et al. (2007).
A list with the following components:
Zrow |
the vector of length 2^{Elevel +Rlevel }+1 containing the discretization
of the x axis. |
Zcol |
the vector of length 2^{Elevel +Rlevel }+1 containing the discretization
of the y axis. |
Z |
the matrix of size (2^{Elevel +Rlevel }+1)x(2^{Elevel +Rlevel }+1)
in such a way Z [i,j] containing the value of the process at point (Zrow [i],Zcol [j]) |
time |
the CPU time |
Alexandre Brouste (http://ljk.imag.fr/membres/Alexandre.Brouste) and Sophie Lambert-Lacroix (http://ljk.imag.fr/membres/Sophie.Lambert).
A. Brouste, J. Istas and S. Lambert-Lacroix (2007). On Gaussian random fields simulations.
# load FieldSim library library(FieldSim) #Example 1: Fractional Brownian Field R<-function(x,H=0.9){1/2*((x[1]^2+x[2]^2)^(H)+(x[3]^2+x[4]^2)^(H)-((x[1]-x[3])^2+(x[2]-x[4])^2)^(H))} res<- fieldsim(R,Elevel=1,Rlevel=5,nbNeighbor=4) # Plot x <- res$Zrow y <- res$Zcol z <- res$Z persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue") #Example 1: Multifractional Brownian Field F<-function(y){0.4*y+0.5} R<-function(x,Fun=F){ H1<-Fun(x[1]) H2<-Fun(x[3]) alpha<-1/2*(H1+H2) C2D(alpha)^2/(2*C2D(H1)*C2D(H2))*((x[1]^2+x[2]^2)^(alpha)+(x[3]^2+x[4]^2)^(alpha)-((x[1]-x[3])^2+(x[2]-x[4])^2)^(alpha)) } res<- fieldsim(R,Elevel=1,Rlevel=5,nbNeighbor=4) # Plot x <- res$Zrow y <- res$Zcol z <- res$Z persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue")