One posterior draw of the intensity surface
gp_draw.RdGenerates a single posterior sample of \(\lambda = \exp(z)\) under the Gaussian working model on the log scale with heteroscedastic variance \(D\). It draws a GP prior realisation \(\eta \sim \mathcal N(0, K)\), adds working-likelihood noise \(\varepsilon \sim \mathcal N(0, D)\) on the observed log scale, solves \((S K S^\top + D)\alpha_{\sim} = (S\eta + \varepsilon) - y_{\text{work}}\), and returns \(\exp(\eta - K S^\top \alpha_{\sim} + \mu_{\mathrm{infer}})\).
Arguments
- state
A sampler state created by
gp_build_state(), containing at leastspace_mat,time_mat,obs_idx,N,y_work,noise_var,kdiag_full,A_solve, andmu_infer. The vector layout is sites × times with time varying fastest.- tol
Convergence tolerance passed to the inner PCG solve.