Learn R Programming

BayesianDisaggregation (version 0.1.2)

interpretability_score: Interpretability score (structure preservation + plausibility)

Description

Balances two ideas: (i) preservation of the average sectoral structure (correlation between colMeans(P) y colMeans(W); truncated at 0), and (ii) plausibility of relative changes \(|W\_bar - P\_bar| / (P\_bar + \varepsilon)\), summarized by the 90th percentile (or the maximum). The score is $$0.6\cdot \mathrm{preservation} + 0.4\cdot \frac{1}{1+2\cdot \mathrm{change}}.$$

Usage

interpretability_score(P, W, use_q90 = TRUE)

Value

Scalar interpretability score in \([0,1]\).

Arguments

P

Prior matrix (\(T \times K\)).

W

Posterior matrix (\(T \times K\)).

use_q90

If TRUE (default), use 90th percentile of relative changes; if FALSE, use the maximum.

Examples

Run this code
T <- 6; K <- 5
P <- matrix(runif(T*K), T); P <- P/rowSums(P)
W <- matrix(runif(T*K), T); W <- W/rowSums(W)
interpretability_score(P, W)

Run the code above in your browser using DataLab