Skip to content

Commit dd7544c

Browse files
committed
adding marimo notebook
1 parent 3c0fd87 commit dd7544c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

_posts/2024-11-18-Conditioning_joint_gaussian_on_sum.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Let $X$ be a jointly Gaussian (j-g) random vector with mean $\mu\in\mathbf{R}^n$
1212

1313
As in the [prior post]({{ "/conditional_distribution_for_jointly_gaussian_random_vectors/" | absolute_url}}), we will exploit the unique property of Gaussians that uncorrelated variables are also independent.
1414

15+
There is a [Marimo notebook](https://marimo.app/#code/JYWwDg9gTgLgBCAhlUEBQaD6mDmBTAOzykRjwBNMB3YGACzgF44AiABgDoBODgRi4C05PADcAzCzSIwYJgmSoOAQRkAKAJQY0AAWlgOAYzwAbY2mEAzONlUgI6gFxo4LuFACuBTACN3MGBAEcnYc7sAcvv6BqsaI3iaMLERUcOSkiCyargjumADOxsDCUMEQoeEFRcSqAgBMADRwDXCcvI2x8caJIO4sjSKIxu54jGxZrnn5hcWl5RyVxTXNza3tcQkseX1wA0MjY86uIXR5MIgGANaqANoeXpEBBI09U1VQjZMLxAC64y5QeBg7igQReX3ebk8Pj8jw+r2KWl0MkMJjMlmsmFUBDAjTu0KiBEch3+UIegWJcAAxHB8EQSGQ4Ig4AAFADKABE4AYIAMUIgCEZ5DAUAAPClIYXAEWs4AALzwcl4bApAFk5NiOCQCOQICBNfzyLZSKKZfLnsapaa8H84AAhdX6HUwVQqxoqjjC-l5SB5PAadRwADULT4cAAVHANXgAJ5+iUmuXWinUgyDAzuWIMkQUzAQB0cQJ4PJGyXSxM2kRyVT27TWexwAD0cFUuY4ABU4LWa3WbSm0xnSAqlBSlPmY3GLWX5QGBJH9BA-NURI0NYXi-HLeWbQCgSC4EpGra3ebS1b+oi9CjTOY8FYbEe4GBjDAPgQ8kTsnk3xw6HhSEgwGrRoDAAxIn0QPIkEyCknxgD1aGMP0WGgYAcGAAhBi5HkFH5QUNxFaDslgjgcAMCwNApHdgQIC9kSMa90RsA87UaWDX3fJxsltTBkjkUcu07fd2wpL88h-P8YAA6seLwKhgNAlhwMgjIbWImAEKQ9wwDSMhyCw3lgFwhV8MI1xiNI8jt0Bajm245J6k0DAkX0ei0VvDEgLtGS5LnVjnw-Mzn3mMgQCxR1DJwat1DWTpEhQtCMOMUyXGI048FCjVyAi6Tkmi+QoAuYgLBAGBEgImKNi0nSKGSx8gvUmBENUFgssQHBAjyOAICsbkREMvkBWMi0jC2VSgsQ2lDTGuCLIo7IqJBWiXNRG870xZj8LPBAIGeXJwRXHE4E+aZiH6AKXGpdDvTwAx4Cqwc9JAP8CA4OBaCOugF2MPS8ncEA4ACLrvF9KARAoI7xVyXjmGOt4OF2YZwx2IN90E2w9pOqB4cGRGI1XIh10nK11BtEIRFOc4rmuDVftCl5ct27zfko6y93R7yHKWq83LWsK-JfHZzqpLlf0uAG6FIZHgE6pk8lAJ88BFRpwjwV6CECAQiBwUhgDBxkglpzrAd4GCgrS0KRGm+DGr9CwWGXI6-sYABvGm-tUS2HA4WoLAAX1q8yyLm1wFpopzL1c1aPOYtijrfIXRPE-9pFUZiQOkMDYmUgOgtmqzdzDnQI5Wxj1oO-mhbwVDdkaKucDBgx80KRKcA4Ou6FTq3zdUOvditvOWYLuBe8GWvq5urnI9LjRONceXoHgJAUDsRlOrsCl59gSM-rAaNV7nDfwAXo6-28aAggguO8kPyAt4lJ8IEa4BvA4XeH-gS-YMHmy7HLuqBdEloYAa0MJPWwEwZgLBsBIHQtgFgs8XCXjuBRIAA) accompanying this post that allows you to play with some relevent numerical experiments. It runs in your browser, so feel free to edit and play around!
16+
1517
### The Formula
1618

1719
The distribution of $X$ given the observation that the sum $S=s$ is given by
@@ -71,4 +73,4 @@ thus proving the first result.
7173

7274
Note that both $v$ and $A$ do not depend at all on $s$ and can be pre-calculated. The entries of $v$ are all on the interval $[0,1]$ and, in fact, form a simplex (their values sum to $1$). The posterior mean is always updated to be exactly consistent with the observed sum.
7375

74-
$A$ has rank $n-1$ with exactly one negative eigenvalue, and so the covariance is always shrunk in a way that depends on the original covariance matrix. This has the effect in which blocks of more highly correlated variable will have their variance (diagonal entries) shrunk more than independent variables.
76+
$A$ has rank $n-1$ with exactly one "near-zero" eigenvalue, and so the covariance is always shrunk in a way that depends on the original covariance matrix. This has the effect in which blocks of more highly correlated variable will have their variance (diagonal entries) shrunk more than independent variables.

0 commit comments

Comments
 (0)