MM | R Documentation |
Various multiplicative multinomial probability utilities for different types of observation
MM(y,n=NULL,paras)
MM_allsamesum(y, n=NULL, paras)
MM_differsums(y, n=NULL, paras)
MM_allsamesum_A(y, paras)
MM_differsums_A(y, paras)
MM_single(yrow, paras, givelog=FALSE)
MM_support(paras, ss)
y |
Observations: a matrix, each row is a single observation |
yrow |
A single observation corresponding to one row of
matrix |
n |
Integer vector with one element for each row of |
ss |
Sufficient statistics, as returned by |
givelog |
Boolean in |
paras |
Object of class |
Consider non-negative integers \mjeqny_1,...,y_ky_1,...,y_k with \mjeqn\sum y_i=yy_1+...+y_k=y. Then suppose the frequency function of the distribution \mjeqnY_1,...,Y_kY_1,...,Y_k is
\mjdeqnC\cdoty\choose y_1,...,y_k \prod_i=1^k p_i^y_i \prod_1\leq i < j\leq k\theta_ij^y_iy_j omitted; see PDF
where \mjeqnp_i,...,p_k\geq 0p_i,...,p_k >= 0, \mjeqn\sum p_i=1p_1+...+p+k=1 correspond to probabilities; and \mjeqn\theta_ij > 0theta_ij>0 for \mjeqn1\leq i < j\leq k1 <= i < j <= k are additional parameters.
Here \mjseqnC stands for a normalization constant:
\mjdeqnC=C(p,\theta,Y)= \sum_y_1 + \cdots + y_k=y \prod_i=1^k p_i^y_i \prod_1\leq i < j\leq k\theta_ij^y_iy_j omitted; see PDF
which is evaluated numerically. This is computationally expensive.
The usual case is to use function MM()
.
Function MM()
returns the log of the probability of a
matrix of rows of independent multinomial observations. It is a
wrapper for MM_allsamesum()
and
MM_differsums()
. Recall that optional argument n
specifies the number of times that each row is observed. Calls
NormC()
.
Function MM_allsamesum()
gives the log of the
probability of observing a matrix where the rowsums are identical.
Calls NormC()
.
Function MM_differsums()
gives the log of the
probability of observing a matrix where the rowsums are not
necessarily identical. Warning: This function takes a long
time to run. Calls NormC()
, possibly many times.
Functions MM_allsamesum_A()
and
MM_differsums_A()
are analogous to functions
MM_allsamesum()
and MM_differsums()
but interpret the
matrix y
as having rows corresponding to observations; each row
is observed once, as in data(pollen)
. Both call NormC()
.
Function MM_single()
gives a likelihood function for a
paras
object with a single multinomial observation (that is,
a single line of matrix y
). Does not call NormC()
.
Function MM_support()
gives the support (that is, the
log-likelihood) of a paras
object; argument ss
is the
sufficient statistic, as returned by suffstats()
. Does not
call NormC()
.
Function dMM()
[documented more fully at rMM.Rd
]
gives the probability of a single multivariate observation (ie a
single row of the matrix argument y
). Calls NormC()
.
Robin K. S. Hankin
data(voting)
data(voting)
p <- Lindsey(voting, voting_tally)
MM(voting,voting_tally,p) #No other value of 'p' gives a bigger value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.