num_post_plsv: Numerically Maximize complete Posterior.

Description Usage Arguments Value

Description

Numerically maximize the complete posterior of the PLSV model.

Usage

1
2
3
num_post_plsv(docs, K, V, P, eta, gamma, beta, make_plot = FALSE,
  THETA_init = NULL, PSI_init = NULL, PHI_init = NULL,
  THETA_fix = list(), PSI_fix = list())

Arguments

docs

A list of integer vectors, each subvector representing a document in the form of the indices of its words in the vocab.

K

The number of topics, an integer scalar.

V

The number of unique words, an integer scalar.

P

The dimensionality of the embedding space, an integer, usually 2.

eta

The exchangible dirichlet prior on words in a topic.

beta

The precision for topic locations, a positive scalar.

make_plot

A boolean, if TRUE, will make a ggplot visualization of the topics and documents, with topics in red.

THETA_init

A real matrix with as many rows as docs has and P many columns, giving an initial value for THETA.

PSI_init

A real matrix with K many rows and P many columns, giving an initial value for PSI

PHI_init

A matrix of K many V-1-simplex valued rows, giving the initial value for PHI

THETA_fix

A list of lists, used to fix rows of THETA to a given value. Each sublist has two elements: 'ind' and 'val'. 'ind' Indicates the row, 1-index, of THETA to fix, and 'val', a real valued P-vector, indicates the value to fix it to.

gama

The precision for document locations, a positive scalar.

Value

A list containing ests, a list with PHI, the topic by document matrix, THETA, the document locations in P-D space, and PSI, the topic locations in P-D space.


NathanWycoff/iPLSV documentation built on May 16, 2019, 11:10 p.m.