Skip to contents

Building the field as a sum of sinusoids with random amplitudes and uniform random phases gives C(h) = sum_j sigma_j^2 cos(w_j h) (eq 2.27), and in the limit C(h) = int cos(w h) s(w) dw with inverse s(w) = (1 / 2pi) int cos(w h) C(h) dh. Both C and s are even, so only cosine terms survive.

Usage

spwkth(cov_func, omega = NULL, h_max = 200, n = 40001)

Arguments

cov_func

Function C(h) on the line.

omega

Frequencies at which to return the density.

h_max, n

Half-width and node count of the quadrature grid.

Value

Named list: omega, spectral_density, variance, integrated_density, nyquist_omega.

Details

Both integrals are numerical. The omega grid cannot outrun the h grid: cos(w h) sampled at spacing dh aliases above the Nyquist frequency pi / dh, and integrating past it sums noise rather than tail mass, so a wider range makes the answer worse. The range is capped there and the limit reported; integrated_density must equal C(0), and the shortfall is the tail truncated away.

References

Schabenberger & Gotway (2005), Sec 2.5.3, eq (2.27), pp. 66-68.

Examples

# \donttest{
spwkth(function(h) exp(-2 * abs(h)), omega = c(0, 1, 3))$spectral_density
#> [1] 0.15916025 0.12732926 0.04897606
# }