Computes the summary count statistics of a field given an interaction structure and a restriction family.

  • cohist() computes the co-ocurrence histogram.

  • smr_stat() computes the co-ocurrence histogram, then converts it into a vector of sufficient statistics given a family of restrictions.

smr_stat(Z, mrfi, family)

cohist(Z, mrfi)

vec_description(mrfi, family, C)

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.

C

The maximum value of the field.

Value

A numeric vector with the summarized counts. An array representing the co-ocurrence histogram of Z in the relative positions contained in mrfi. Each row and column corresponds a pair of values in (0, ..., C) and each slice corresponds to A data.frame describing the relative position and interaction associated with each potential in the vector form in each row, in the same order.

Details

The order the summarized counts appear in the summary vector matches the order in smr_array().

See also

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

Author

Victor Freguglia

Examples

smr_stat(Z_potts, mrfi(1), "onepar")
#> [1] 11695
smr_stat(Z_potts, mrfi(1), "oneeach")
#> [1] 5901 5794

cohist(Z_potts, mrfi(1))
#> , , (1,0)
#> 
#>      0    1    2
#> 0 6179  962 1037
#> 1  933 4855  966
#> 2 1052  951 5415
#> 
#> , , (0,1)
#> 
#>      0    1    2
#> 0 6222  973  992
#> 1  988 4826  940
#> 2  969  932 5508
#>