RPspectral: Spectral turning bands method

Description Usage Arguments Value References See Also Examples

View source: R/RMmodels.R

Description

The spectral turning bands method is a simulation method for stationary Gaussian random fields (Mantoglou and Wilson, 1982). It makes use of Bochners's theorem and the corresponding spectral measure Ξ for a given covariance function C(h). For x in R^d, the field

Y(x)=√{2} cos(<V,x> + 2 pi U)

with V ~ Ξ and U ~ Ufo((0,1)) is a random field with covariance function C(h). A scaled superposition of many independent realizations of Y gives a Gaussian field according to the central limit theorem. For details see Lantuejoul (2002). The standard method allows for the simulation of 2-dimensional random fields defined on arbitrary points or arbitrary grids.

Usage

1
RPspectral(phi, boxcox, sp_lines, sp_grid, prop_factor, sigma) 

Arguments

phi

object of class RMmodel; specifies the covariance model to be simulated.

boxcox

the one or two parameters of the box cox transformation. If not given, the globally defined parameters are used. See RFboxcox for details.

sp_lines

Number of lines used (in total for all additive components of the covariance function).

Default: 2500.

sp_grid

Logical. The angle of the lines is random if grid=FALSE, and kπ/sp_lines for k in 1:sp_lines, otherwise. This argument is only considered if the spectral measure, not the density is used.

Default: TRUE.

prop_factor

positive real value. Sometimes, the spectral density must be sampled by MCMC. Let p be the average rejection rate. Then the chain is sampled every nth point where n = |log(p)| *prop_factor.

Default: 50.

sigma

real. Considered if the Metropolis algorithm is used. It gives the standard deviation of the multivariate normal distribution of the proposing distribution. If sigma is not positive then RandomFields tries to find a good choice for sigma itself.

Default: 0.

Value

RPspectral returns an object of class RMmodel.

References

See Also

Gaussian, RP, RPtbm.

Examples

1
2
3
4
5
6
7
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

model <- RPspectral(RMmatern(nu=1))
y <- x <- seq(0,10, len=400)
z <- RFsimulate(model, x, y, n=2)
plot(z)

Example output

Loading required package: sp
Loading required package: RandomFieldsUtils

Attaching package: 'RandomFields'

The following object is masked from 'package:RandomFieldsUtils':

    RFoptions

NOTE: simulation is performed with fixed random seed 0.
Set 'RFoptions(seed=NA)' to make the seed arbitrary.
..
New output format of RFsimulate: S4 object of class 'RFsp';
for a bare, but faster array format use 'RFoptions(spConform=FALSE)'.

RandomFields documentation built on Jan. 19, 2022, 1:06 a.m.