calc_imi: IMI calculation routine

calc_imiR Documentation

IMI calculation routine

Description

The actual computation of IMI (instantaneous mutual information) values for imi_topic is done by this routine. If you are calling imi_topic repeatedly for a given topic, you can gain some speed by pre-calculating the inputs and supplying them directly to this function.

Usage

calc_imi(doc_topics_k, term_doc_k)

Arguments

doc_topics_k

vector of counts, one for each document, of words assigned to topic k

term_doc_k

matrix of counts, where element i,j is the number of words of type i in document (or document-group) j is assigned to topic k

Value

a vector of scores, one for each row of term_doc_k

References

I have referred to a helpful note by David Mimno here: https://lists.cs.princeton.edu/pipermail/topic-models/2012-March/001779.html.

See Also

imi_topic which calls this; see under "Details" there for more detail on IMI


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.