Archive for Xi’an’s Og

math that jaX [on the ‘Og]

Posted in Linux, pictures, University life with tags , , , , , , , , , , , on November 4, 2026 by xi'an

Two weeks ago, I got sufficiently annoyed by the poor rendering of the base WordPress interface for \{\LaTeX\) formulas and equations to search for an easy move to ennabling MathJax. A few exchanges with Claude, ChatGPT, and Gemini later, it appeared that the solution was quite simple had been available for quite a while (!), and consisted in loading the MathJax-LaTeX plugin in my WordPress site, provided I adopted a personal version for its primary. Which is why it is now xianblog.fr instead of xianblog.wordpress.com, still operational. (I would have preferred xianblog.eu ou xianblog.world, but these suffixes were not proposed.) As a result, readers may see more math in the posts, and a renewed majority of paper discussions!

For instance, here is Claude’s lengthy rendering of the posterior median being the optimal Bayes estimator under absolute error loss:

Let \(\theta\) have posterior distribution \(\pi(\theta \mid x)\), and assume \(\mathbb{E}[\,|\theta| \mid x\,] < \infty\) so that the posterior expected absolute error \[ \rho(a) = \mathbb{E}\big[\,|\theta – a| \;\big|\; x\,\big] \] is finite for every \(a \in \mathbb{R}\). A posterior median is any \(m\) such that \[ P(\theta \le m \mid x) \ge \frac{1}{2} \quad \text{and} \quad P(\theta \ge m \mid x) \ge \frac{1}{2}. \] Claim: For every \(a \in \mathbb{R}\), \(\rho(a) \ge \rho(m)\).

Proof Case 1: \(a > m\). Compare \(|\theta – a|\) and \(|\theta – m|\) on three regions:

\[
|\theta – a| – |\theta – m| =
\begin{cases}
(a – \theta) – (m – \theta) = a – m, & \theta \le m, \\[4pt]
(a – \theta) – (\theta – m) = a + m – 2\theta, & m < \theta < a, \\[4pt]
(\theta – a) – (\theta – m) = -(a – m), & \theta \ge a.
\end{cases}
\]

On the middle region, \(\theta < a\) gives \(a + m – 2\theta > a + m – 2a = -(a – m)\). So for all \(\theta\),

\[
|\theta – a| – |\theta – m| \;\ge\; (a – m)\Big[\mathbf{1}\{\theta \le m\} – \mathbf{1}\{\theta > m\}\Big].
\]

Taking posterior expectations, which is allowed because both sides are bounded by \(|a – m|\):

\[
\rho(a) – \rho(m) \;\ge\; (a – m)\Big[P(\theta \le m \mid x) – P(\theta > m \mid x)\Big]
= (a – m)\Big[2\,P(\theta \le m \mid x) – 1\Big].
\]

Since \(a – m > 0\) and \(P(\theta \le m \mid x) \ge \frac12\), the right-hand side is \(\ge 0\). Hence \(\rho(a) \ge \rho(m)\).

Case 2: \(a < m\). By the symmetric argument, with the roles of the left and right tails swapped,

\[
|\theta – a| – |\theta – m| \;\ge\; (m – a)\Big[\mathbf{1}\{\theta \ge m\} – \mathbf{1}\{\theta < m\}\Big], \] so \[ \rho(a) – \rho(m) \;\ge\; (m – a)\Big[2\,P(\theta \ge m \mid x) – 1\Big] \;\ge\; 0, \] using \(m – a > 0\) and \(P(\theta \ge m \mid x) \ge \frac12\).

Case 3: \(a = m\). This case is trivial.

Therefore

\[
m \in \arg\min_{a \in \mathbb{R}} \; \mathbb{E}\big[\,|\theta – a| \;\big|\; x\,\big].
\]

Tidy up, Claude!

Posted in Linux, Mountains, pictures, Statistics, Travel, University life with tags , , , , , , , , , , , , , , , , , on September 27, 2026 by xi'an

Nothing out of the ordinary there, but after years of procrastination at failing to update my publication webpage, following a wreckage by the default web composer on Ubuntu (and yours truly obviously!), I took advantage of the extra energy gained by my altitude night at the 5th station to ask Claude to update this page, with it replying it preferred to start from scratch (and from my LaTeX vita files). The only drawback is that many of the links introduced in the earlier version were not retrieved by the AI, despite my repeated request. On the plus side, trawling for missing entries and unpublished arXiv oldies but goldies, as well as adding mountain pictures (from the ‘Og!) proved much easier than the manual-by-keyboard approach. And I got an extra bonus in updating my LaTeX publication file and by creating the corresponding bibTeX file, all now available on my github page.

38ième semi-marathon d’Argentan

Posted in pictures, Running with tags , , , , , , , , , , , , , , on October 5, 2024 by xi'an

what is the caption?!

Posted in Books with tags , , , , , on July 27, 2023 by xi'an