Description Usage Arguments Details Value Author(s) References See Also Examples
infer_Z
uses an sibp object fitted on a training set to infer the treatments in a test set.
1 |
sibp.fit |
A |
X |
The covariates for the data set where Z is to be inferred. Usually, the user should Use the same X used to call the sibp function. |
newX |
Set to TRUE if the X supplied is not the training and test set. Used primarily for followup validation experiments. Defaults to FALSE. |
This function applies the mapping from words to treatments discovered in the training set to infer which observations have which treatments in the test set. Usually, users will be better served by calling sibp_amce
, which calls this function internally before returning estimates and confidence intervals for the average marginal component effects.
nu |
Informally, the probability that the row document has the column treatment. Formally, the parameter for the variatioanl approximation of z_i,k, which is a Bernoulli distribution. |
Christian Fong
Fong, Christian and Justin Grimmer. 2016. “Discovery of Treatments from Text Corpora” Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics. https://aclweb.org/anthology/P/P16/P16-1151.pdf
sibp, sibp_amce
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##Load the Wikipedia biography data
data(BioSample)
# Divide into training and test sets
Y <- BioSample[,1]
X <- BioSample[,-1]
set.seed(1)
train.ind <- sample(1:nrow(X), size = 0.5*nrow(X), replace = FALSE)
# Fit an sIBP on the training data
sibp.fit <- sibp(X, Y, K = 2, alpha = 4, sigmasq.n = 0.8,
train.ind = train.ind)
# Infer the latent treatments in the test set
infer_Z(sibp.fit, X)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.