pl_mrf2d: Pseudo-likelihood function for MRFs on 2d lattices

View source: R/pseudo_likelihood.R

pl_mrf2dR Documentation

Pseudo-likelihood function for MRFs on 2d lattices

Description

Computes the pseudo-likelihood function of a Markov Random Field on a 2-dimensional lattice.

Usage

pl_mrf2d(Z, mrfi, theta, log_scale = TRUE)

Arguments

Z

A matrix with integers in {0,...,C}.

mrfi

A mrfi object representing the interaction structure.

theta

A 3-dimensional array describing potentials. Slices represent interacting positions, rows represent pixel values and columns represent neighbor values. As an example: theta[1,3,2] has the potential for the pair of values 0,2 observed in the second relative position of mrfi.

log_scale

A logical value indicating whether the returned value should be in logarithmic scale.

Details

The pseudo-likelihood function is defined as the product of conditional probabilities of each pixel given its neighbors:

∏_i P(Z_i | Z_{{N}_i}, θ).

Value

A numeric with the pseudo-likelihood value.

Author(s)

Victor Freguglia

See Also

A paper with detailed description of the package can be found at doi: 10.18637/jss.v101.i08.

Examples

pl_mrf2d(Z_potts, mrfi(1), theta_potts)


Freguglia/mrf2d documentation built on Feb. 13, 2023, 3:29 a.m.