fit_pl {mrf2d}R Documentation

Maximum Pseudo-likelihood fitting of MRFs on 2d lattices.

Description

Parameter estimation for Markov random fields via Pseudo-Likelihood function optimization. See pl_mrf2d for information on the Pseudo-Likelihood function.

Usage

fit_pl(
  Z,
  mrfi,
  family = "onepar",
  init = 0,
  optim_args = list(method = "BFGS"),
  return_optim = FALSE
)

Arguments

Z

A matrix object containing the observed MRF. NA values can be used to create a subregion of the lattice for non-rectangular data.

mrfi

A mrfi object representing the interaction structure.

family

The family of parameter restrictions to potentials. Families are: 'onepar', 'oneeach', 'absdif', 'dif' or 'free'. See mrf2d-familiy.

init

The initial value to be used in the optimization. It can be:

  • A valid array of parameter values according to family.

  • 0. If set to 0 an array with '0“ in all entries is created.

optim_args

Additional parameters passed to optim().

return_optim

logical indicating whether information from the optim() call are returned.

Value

An object of class mrfout with elements:

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

fit_pl(Z_potts, mrfi(1), family = "onepar")
fit_pl(Z_potts, mrfi(1), family = "oneeach")
fit_pl(Z_potts, mrfi(2), family = "onepar")


[Package mrf2d version 1.0 Index]