Bayes estimator under weighted absolute loss (source code)

= Bayes estimator under weighted absolute loss
{c}
{title2=$a\in\operatorname{Median}(w(\theta)\pi(\theta\mid x))$}

= Weighted posterior median
{synonym}

Under loss $w(\theta)|\theta-a|$, assume $0<\mathbb E[w(\theta)\mid x]<\infty$. The <posterior expected loss> is a positive constant times ordinary <absolute-error loss> under the probability density proportional to $w(\theta)\pi(\theta\mid x)$. Its minimizers are the <medians> of that weighted posterior: slopes of the loss change sign where the weighted probability below $a$ crosses one half. In particular, relative absolute loss has $w(\theta)=1/\theta$ for positive parameters. For a <Gamma distribution> posterior of shape two and rate $b$, the weighted posterior is an <exponential distribution> of rate $b$, so the estimate is $(\log2)/b$.