Rescale observed counts to a common sample size factor
Source:R/posterior_predict.R
normalize_counts.RdNormalises observed counts by the posterior estimate of their sample size
factor and re-expresses them at a chosen r_pred, giving
\(\lfloor y_{imj} / \exp(\hat r_{im} - r^{\mathrm{pred}}_m)\rfloor\).
These are the values plotted as crosses on top of the posterior predictive
densities in the paper.
Arguments
- fit
A fitted
"spbgfm"object.- features
Integer vector of feature (column) indices in the concatenated table, or
NULL(default) for all features.- r_pred
Sample size factor of the new sample: a single number applied to all domains, or a length-\(M\) vector. Default
0, matching the figures in the paper.- log
Logical; return
log(count + 1)instead of the count. DefaultFALSE.