smr_array: Summarized representation of theta arrays

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/suf_stat.R

Description

smr_array creates a vector containing only the free parameters from an array given a restriction family. exapand_array is the reverse operation, expanding a complete array from the vector of sufficient statistics.

Usage

1
2
3
smr_array(theta, family)

expand_array(theta_vec, family, mrfi, C)

Arguments

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.

family

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

theta_vec

A numeric vector with the free parameters of a potential array. It's dimension depends on the restriction family, C and the number of interacting positions on mrfi.

mrfi

A mrfi object representing the interaction structure.

C

The maximum value of the field.

Details

The order the parameters appear in the summarized vector matches the order in smr_stat().

vec_description() provides a data.frame object describing which are the relative positions and interactions associated with each element of the summarized vector in the same order.

Value

smr_array returns a numeric vector with the free parameters of theta.

expand_array returns a three-dimensional array of potentials.

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

1
2
3
4
5
smr_array(theta_potts, "onepar")
smr_array(theta_potts, "oneeach")

expand_array(0.99, family = "onepar", mrfi = mrfi(1), C = 2)
expand_array(c(0.1, 0.2), family = "oneeach", mrfi = mrfi(1), C = 3)

mrf2d documentation built on Jan. 26, 2022, 1:06 a.m.