Forward Filtering Backward Sampling algorithm for sampling from the joint full conditional of the coefficients \(\alpha\) and for evaluation of the log-likelihood.
ffbs.spectral(w=NULL,wFT=NULL,spec=NULL,Gvec=NULL,tau2=NULL,par=NULL,n,T,lglk=FALSE,
BwSp=TRUE,NF=n*n,indCos=(1:((n*n-4)/2)*2+3),ns=4,nu=1,dt=1)
A list with entries (depending on whether 'lglk' are 'BwSp' are 'TRUE' or 'FALSE'):
A T x n*n matrix with a sample from the full conditional of latent process \(\alpha\),
The evaluated log-likelihood,
Observed data or latent process w (depending on which data model is used) in an T x n*n matrix with columns and rows (points on a grid stacked into a vector) corresponding to time and space, respectively.
Vector of length T*n*n containing the real Fourier transform of 'w'.
Spectrum of the innovations \(\hat{\epsilon}\) in a vector of length n*n. If 'spec' is not given, it is constructed based on 'par'.
The propagator matrix G in vector format obtained from 'get.G.vec'. If 'Gvec' is not given, it is constructed based on 'par'.
Measurement error variance tau2. If 'NULL'; tau2=par[9].
Vector of parameters for the SPDE in the following order: rho_0, sigma^2, zeta, rho_1, gamma, alpha, mu_x, mu_y, tau^2. If 'spec' and 'Gvec' are given, 'par' will not be used.
Number of grid points on each axis. n*n is the total number of spatial points.
Number of points in time.
Logical; if 'TRUE' the value of the log-likelihood is returned as well.
Logical; if 'TRUE' a sample from the full conditional of \(\alpha\) is returned.
Number of Fourier functions used.
Vector of integers indicating the position cosine terms in the 1:NF real Fourier functions. The first 'ns' cosine wavenumbers in 'wave' are not included in 'indCos'.
Number of real Fourier functions that have only a cosine and no sine term. 'ns' is maximal 4.
Smoothness parameter of the Matern covariance function for the innovations. By default this equals 1 corresponding to the Whittle covariance function.
Temporal lag between two time points. By default, this equals 1.
Fabio Sigrist