matern.spec | R Documentation |
Spectrum of the Matern covariance function. Note that the spectrum is
renormalized, by dividing with the sum over all frequencies so that
they sum to one, so that
\sigma^2
is the marginal variance no matter how many
wavenumbers are included.
matern.spec(wave, n, ns=4, rho0, sigma2, nu = 1, norm = TRUE)
wave |
Spatial wavenumbers. |
n |
Number of grid points on each axis. n x n is the total number of spatial points. |
ns |
Integer indicating the number of cosine-only terms. Maximally this is 4. |
rho0 |
Range parameter. |
sigma2 |
Marginal variance parameter. |
nu |
Smoothness parameter of the Matern covariance function. By default this equals 1 corresponding to the Whittle covariance function. |
norm |
logical; if 'TRUE' the spectrum is multiplied by n*n so that after applying the real Fourier transform 'real.FFT' one has the correct normalization. |
The Matern covariance function is of the form
\sigma^2 2^(1-\nu) \Gamma(\nu)^{-1} (d/\rho_0)^{\nu} K_{\nu}(d/\rho_0)
with 'd' being the Euclidean distance between two points and K_nu(.) a modified Bessel function. Its spectrum is given by
2^{\nu-1} \nu ((1/\rho_0)^(2\nu)) (\pi*((1/\rho_0)^2 + w)^(\nu + 1))^{-1}
where 'w' is a spatial wavenumber.
Vector with the spectrum of the Matern covariance function.
Fabio Sigrist
n <- 100
spec <- matern.spec(wave=spate.init(n=n,T=1)$wave,n=n,rho0=0.05,sigma2=1,norm=TRUE)
sim <- real.fft(sqrt(spec)*rnorm(n*n),n=n,inv=FALSE)
image(1:n,1:n,matrix(sim,nrow=n),main="Sample from a Gaussian process
with Matern covariance function",xlab="",ylab="",col=cols())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.