Text::NSP::Measures::3D::MI::ps is a Perl module that implements Poisson Stirling Measure for trigrams.
$ps_value = calculateStatistic( n111=>10,
if( ($errorCode = getErrorCode()))
print STDERR $erroCode." - ".getErrorMessage()."n";
print getStatisticName."value for bigram is ".$ps_value."n";
The log-likelihood ratio measures the devitation between the observed data and what would be expected if < word1 >, < word2 > and < word3 > were independent. The higher the score, the less evidence there is in favor of concluding that the words are independent.
The expected values for the internal cells are calculated by taking the product of their associated marginals and dividing by the sample size, for example:
n1pp * np1p * npp1
The poisson stirling measure is a negative lograthimic approximation of the poisson-likelihood measure. It uses the stirlings firmula to approximate the factorial in poisson-likelihood measure. It is computed as follows:
Posson-Stirling = n111 * ( log(n111) - log(m111) - 1)
calculateStatistic() - This method calculates the ps value
INPUT PARAMS : $count_values .. Reference of an hash containing the count values computed by the count.pl program.
RETURN VALUES : $poissonStirling .. Poisson-Stirling value for this trigram.
getStatisticName() - Returns the name of this statistic
INPUT PARAMS : none
RETURN VALUES : $name .. Name of the measure.