α1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.951.0 1.2 1.4 1.6 1.8 2.00.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5Figure 3: Intr<strong>in</strong>sic Embedd<strong>in</strong>g for the Powered Exponential Class. We consider the block circulantmatrix C(P r σ r , 2 · 2048, r/2048) where σ r is given by (12), (13) <strong>and</strong> (14), <strong>and</strong> ϕ is powered exponentialwith shape parameter α <strong>and</strong> scale parameter θ, respectively. The isol<strong>in</strong>es show the smallestvalue <strong>of</strong> r that makes the matrix nonnegative def<strong>in</strong>ite. The white area <strong>in</strong> the (θ, α) plane marksthe parameter comb<strong>in</strong>ations for which no such r could be found.θν0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.251.0 1.2 1.4 1.6 1.8 2.00.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5Figure 4: Same as Figure 3 for Matérn Covariances with Shape Parameter ν <strong>and</strong> Scale Parameter θ.θ12
4 ImplementationWe now describe strategies for choos<strong>in</strong>g a simulation algorithm, <strong>and</strong> we discuss the current computationallimits <strong>of</strong> exact simulation. The cut-<strong>of</strong>f embedd<strong>in</strong>g <strong>and</strong> <strong>in</strong>tr<strong>in</strong>sic embedd<strong>in</strong>g techniqueshave been implemented <strong>in</strong> Version 1.2.5 <strong>of</strong> the R<strong>and</strong>omFields package (Schlather 2001) for theR language (Ihaka <strong>and</strong> Gentleman 1996), <strong>and</strong> we give an example <strong>of</strong> us<strong>in</strong>g this package.4.1 Choice <strong>of</strong> simulation algorithmRecall that we wish to simulate a <strong>Gaussian</strong> surface Z with cov{Z(x), Z(y)} = ϕ(|x − y|) on asquare lattice <strong>of</strong> size n × n, with spac<strong>in</strong>g s/n along each coord<strong>in</strong>ate. Without loss <strong>of</strong> generalitywe can assume that s = 1/ √ 2, which avoids a scal<strong>in</strong>g argument <strong>in</strong> the use <strong>of</strong> the above results.Sophisticated users <strong>of</strong> the R<strong>and</strong>omFields package will specify the desired simulation techniquedirectly, <strong>and</strong> <strong>in</strong> Section 4.3 below we give an example <strong>of</strong> how this can be done. For less experiencedusers, the GaussRF function provides an automated search for a suitable simulation algorithm. Indescrib<strong>in</strong>g this search, we suppose that the fast Fourier transform can be applied to square matrices<strong>of</strong> size at most 2m×2m where m is a power <strong>of</strong> 2. On our 512 MB RAM mach<strong>in</strong>e we found m = 2 048to be a reasonable choice; m = 4 096 was still feasible but caused discont<strong>in</strong>uities <strong>in</strong> the responsetime <strong>of</strong> the system.If n is small, say n ≤ 64, the Cholesky decomposition technique applies <strong>and</strong> performs well. Forlarger systems, the st<strong>and</strong>ard embedd<strong>in</strong>g approach is the most straightforward <strong>and</strong> the most easilyapplicable among the three variants <strong>of</strong> the circulant embedd<strong>in</strong>g technique. Hence, the automatedsearch for an exact simulation algorithm considers the st<strong>and</strong>ard approach first, by check<strong>in</strong>g whetherthe block circulant matrix C(P cs ϕ; 2cn, s/n) is nonnegative def<strong>in</strong>ite for some c ∈ [1, m/n] such thatcn is a highly composite <strong>in</strong>teger. If the st<strong>and</strong>ard embedd<strong>in</strong>g approach fails, the search proceedsbased on the user’s preferences. If the GaussRF parameter stationary.only is set to FALSE,stationarity is not essential, <strong>and</strong> the <strong>in</strong>tr<strong>in</strong>sic embedd<strong>in</strong>g technique provides a particularly efficientalternative. Let c be such that cn is the smallest power <strong>of</strong> two greater than or equal to n/s, <strong>and</strong>def<strong>in</strong>e σ cs as <strong>in</strong> (12). The GaussRF function uses the <strong>in</strong>tr<strong>in</strong>sic embedd<strong>in</strong>g technique if cn ≤ m<strong>and</strong> the block circulant matrix C(P cs σ cs ; 2cn, s/n) is nonnegative def<strong>in</strong>ite, or if 2cn ≤ m <strong>and</strong>C(P 2cs σ 2cs ; 2 · 2cn, s/n) is nonnegative def<strong>in</strong>ite. If the <strong>in</strong>tr<strong>in</strong>sic embedd<strong>in</strong>g approach fails, or if theparameter stationary.only is set to TRUE, the search turns to the cut-<strong>of</strong>f embedd<strong>in</strong>g approach. If(9) or (11) yield a cut-<strong>of</strong>f, r, such that r/s ≤ m/n, we def<strong>in</strong>e ρ by (8) or (10), respectively, f<strong>in</strong>d thesmallest c ≥ r/s such that cn is a highly composite <strong>in</strong>teger, <strong>and</strong> check whether the block circulantmatrix C(P cs ρ; 2cn, s/n) is nonnegative def<strong>in</strong>ite. There is no guarantee that any <strong>of</strong> the approacheswork, <strong>and</strong> exact simulation may not be feasible.At various stages <strong>in</strong> this search, block circulant matrices need to be checked for nonnegativedef<strong>in</strong>iteness. Whenever possible, we use theoretical results or look-up tables for do<strong>in</strong>g this. Aless computationally efficient alternative is to determ<strong>in</strong>e the eigenvalues numerically us<strong>in</strong>g the fastFourier transform. In this numerical test, we consider a block circulant matrix to be nonnegativedef<strong>in</strong>ite if the real parts <strong>of</strong> all eigenvalues are nonnegative <strong>and</strong> the moduli <strong>of</strong> the imag<strong>in</strong>ary parts aresmall (10 −8 or less, thereby allow<strong>in</strong>g for numerical noise). Clearly, ref<strong>in</strong>ements <strong>in</strong> the automatedsearch are possible. To simulate r<strong>and</strong>om fields with st<strong>and</strong>ard covariance structures, for <strong>in</strong>stance, onemight turn to the <strong>in</strong>tr<strong>in</strong>sic embedd<strong>in</strong>g <strong>and</strong> cut-<strong>of</strong>f embedd<strong>in</strong>g approaches directly, without attempt<strong>in</strong>gto <strong>in</strong>voke the st<strong>and</strong>ard approach. Applications <strong>in</strong> environmental risk assessment <strong>and</strong> simulationstudies sometimes require large numbers <strong>of</strong> realizations. In these cases, parallel comput<strong>in</strong>g providesfurther improvements <strong>in</strong> computational feasibility <strong>and</strong> efficiency (Ševčíková 2004).13