Learn R Programming

BayesianDisaggregation (version 0.1.2)

posterior_dirichlet: Dirichlet-conjugate posterior (analytical mean)

Description

Interpreta \(P\) y \(LT\) como proporciones convertidas a pseudo-cuentas con concentración total \(\alpha_{base}=1/\gamma\). El posterior medio es \(W = (P\,\alpha_{base} + LT\,\alpha_{base}) / \mathrm{rowSums}(\cdot)\).

Usage

posterior_dirichlet(P, LT, gamma = 0.1)

Value

Posterior matrix \(W\) (\(T \times K\)), filas suman 1.

Arguments

P

Prior matrix (\(T \times K\)); filas no negativas que suman 1 (o cercanas).

LT

Likelihood matrix (\(T \times K\)); filas no negativas que suman 1 (o cercanas).

gamma

Positive uncertainty factor (default 0.1); menor \(\gamma\) implica mayor concentración (más “seguro”).

See Also

posterior_weighted, posterior_multiplicative, posterior_adaptive

Examples

Run this code
T <- 6; K <- 3
P  <- matrix(runif(T*K), T);  P  <- P  / rowSums(P)
LT <- matrix(runif(T*K), T); LT <- LT / rowSums(LT)
W <- posterior_dirichlet(P, LT, gamma = 0.1)

Run the code above in your browser using DataLab