Posterior mean of the intensity surface
gp_posterior_mean.RdComputes the posterior mean of \(\lambda = \exp(z)\) where \(z = f + \mu_{\mathrm{infer}}\). The latent field \(f\) follows a zero–mean GP with separable covariance \(K = K_{\mathrm{space}} \otimes K_{\mathrm{time}}\). A Gaussian working likelihood on the log scale with heteroscedastic diagonal variance \(D = \mathrm{diag}(\text{noise\_var})\) is used. This evaluates $$f_{\text{hat}} = K S^\top (S K S^\top + D)^{-1} y_{\text{work}},$$ then returns \(\exp(f_{\text{hat}} + \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.