For a description of notation and terminology, see
composite.ll
.
This set of functions is used to generate cached calculations of the
canonical statistic of a Potts model suitable for passing into
composite.ll
or gr.composite.ll
.
All of the calculations using composite.ll
and these
caching functions need one of the color components to be dropped for
the model to be identifiable. For simplicity, the first color is
dropped by generate_t_cache
. In computing the composite log
likelihood for a Potts model with ncolor
colors, we are
interested in many calculations across \(C^A\), the set of all
permutations of colors across a window. These functions facilitate
those calculations. gridcache
is a list of \(C^A\).
generate_t_cache
is the main function, and the others are
intended to be used in conjunction with it. generate_t_cache
creates a list of arrays. Each array represents one window in the
image, and each row of the array contains the value of
\(t(x)\) (with one component dropped) found by replacing the
pixels in that window with one of the elements of \(C^A\).
gengridcache
can generate the gridcache
for any rectangular
window, give the number of colors, size of \(C^A\), and number
of columns in the window. gensingleton
, gentwopixel
,
genfourpixel
, genthreebythree
and genfourbyfour
are all just simple wrappers for gengridcache
.
singleton
, twopixel
, twopixel.nonoverlap
,
fourpixel
, fourpixel.nonoverlap
,
ninepixel.nonoverlap
and sixteenpixel.nonoverlap
are
intended to be passed to generate_t_cache
in the argument
f
. They are used to calculate \(t(ca_{idx} \cup X \setminus
A_a)\) for the
\(\texttt{idx}^{th}\) element of \(C^{A_a}\).
Functions that have overlap
and nonoverlap
versions
generate a overlapping and nonoverlapping set of windows respectively.
singleton
is for a single pixel window (Besag or MPLE).
twopixel
does a two horizontal pixel window.
fourpixel
does a two by two pixel window.
ninepixel
does a three by three pixel window.
sixteenpixel
does a four by four pixel window.