% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/renormalize.R
\name{target_power}
\alias{target_power}
\title{Find target power for renormalization}
\usage{
target_power(tidy_df, group_col, p_col, target_entropy)
}
\arguments{
\item{tidy_df}{The tidied distribution dataframe}

\item{group_col}{Grouping column, RHS of the conditional probability distribution, eg, topics for word-topic distributions}

\item{p_col}{Column containing the probability for each category (eg, word) conditional on the group (eg, topic)}

\item{target_entropy}{Target entropy}
}
\value{
Mean exponent to renormalize to the target entropy
}
\description{
Given a tidied dataframe of topic-doc or word-topic distributions and a target entropy, find the mean exponent needed to adjust the temperature of each distribution to approximately match the target entropy.
}
\examples{
\donttest{
set.seed(42)
theta  = rdirichlet(50, 1, k = 3)
phi    = rdirichlet(3, 0.1, k = 20)
corpus = draw_corpus(rep(50L, 50), theta, phi)
model  = tmfast(corpus, n = 3)
beta   = tidy(model, matrix = 'beta', k = 3)
target_power(beta, topic, beta, target_entropy = 2)
}
}
