which is evaluated numerically. This is 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().
Author(s)
Robin K. S. Hankin
Examples
data(voting)
data(voting)
p <- Lindsey(voting, voting_tally)
MM(voting,voting_tally,p) #No other value of 'p' gives a bigger value
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MM)
Loading required package: magic
Loading required package: abind
Loading required package: partitions
Loading required package: emulator
Loading required package: mvtnorm
Loading required package: Oarray
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MM/MM.Rd_%03d_medium.png", width=480, height=480)
> ### Name: MM
> ### Title: Various multiplicative multinomial probability utilities
> ### Aliases: MM MM_allsamesum MM_differsums MM_allsamesum_A MM_differsums_A
> ### MM_single MM_support
>
> ### ** Examples
>
> data(voting)
>
> data(voting)
> p <- Lindsey(voting, voting_tally)
>
> MM(voting,voting_tally,p) #No other value of 'p' gives a bigger value
[1] -254.0724
>
>
>
>
>
>
>
> dev.off()
null device
1
>