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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pseudo_likelihood.R

Description

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

Usage

1
2
3
4
5
6
7
8
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 https://arxiv.org/abs/2006.00383

Examples

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

mrf2d documentation built on Oct. 30, 2020, 1:07 a.m.