generate random number with GStools

Viewed 36

How can I generate random field with GStools for my correlation function: c(x)= (x)^(a-2)/(x^2 + 1)^(a/2) for differences values x and a=0.5?

2 Answers

Maybe you want to wrap it in a small function, fix a and put random numbers in x?

crl <- function(x, a) x^(a - 2)/(x^2 + 1)^(a/2) 

set.seed(42)
n <- 5
crl(x=runif(n), a=.5)
# [1] 0.9817182 0.9416899 6.4060282 1.1589985 1.7844713

This is not possible with GSTools, since your covariance model is unbound, which refers to an infinite variance of the random field. GSTools only supports random fields with finite mean and variance.

Related