Forward Filtering Backward Sampling algorithm in the spectral space of the SPDE.

Description

Forward Filtering Backward Sampling algorithm for sampling from the joint full conditional of the coefficients α and for evaluation of the log-likelihood.

Usage

1
2
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)

Arguments

w

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.

wFT

Vector of length T*n*n containing the real Fourier transform of 'w'.

spec

Spectrum of the innovations \hat{ε} in a vector of length n*n. If 'spec' is not given, it is constructed based on 'par'.

Gvec

The propagator matrix G in vector format obtained from 'get.G.vec'. If 'Gvec' is not given, it is constructed based on 'par'.

tau2

Measurement error variance tau2. If 'NULL'; tau2=par[9].

par

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.

n

Number of grid points on each axis. n*n is the total number of spatial points.

T

Number of points in time.

lglk

Logical; if 'TRUE' the value of the log-likelihood is returned as well.

BwSp

Logical; if 'TRUE' a sample from the full conditional of α is returned.

NF

Number of Fourier functions used.

indCos

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'.

ns

Number of real Fourier functions that have only a cosine and no sine term. 'ns' is maximal 4.

nu

Smoothness parameter of the Matern covariance function for the innovations. By default this equals 1 corresponding to the Whittle covariance function.

dt

Temporal lag between two time points. By default, this equals 1.

Value

A list with entries (depending on whether 'lglk' are 'BwSp' are 'TRUE' or 'FALSE'):

simAlpha

A T x n*n matrix with a sample from the full conditional of latent process α,

ll

The evaluated log-likelihood,

Author(s)

Fabio Sigrist

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.