Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] distributions: add missing explicit energy computations #267

Open
fkiraly opened this issue Apr 22, 2024 · 0 comments
Open

[ENH] distributions: add missing explicit energy computations #267

fkiraly opened this issue Apr 22, 2024 · 0 comments
Labels
enhancement feature request New feature or request good first issue Good for newcomers module:probability&simulation probability distributions and simulators

Comments

@fkiraly
Copy link
Collaborator

fkiraly commented Apr 22, 2024

A number of existing distibutions have no energy formula implemented. In many cases, it is possible to obtain an analytic or numerically explicit formula, while the default delegates to a much less efficient Monte Carlo approximation.

Recipe:

  1. find any disttibution without energy or _energy_ etc implementations
  2. look up or derive the energy formula
  3. implement in the distirbution
  4. check against the Monte Carlo default, these should be close.

How to obtain the energy formula, there are multiple options:

Some partial derivations and discussions can also be found here:
#219
#220

Also, some of the above sources do not give energy, but CRPS - the two are related, by definition as

$$d.\mbox{CRPS}(y) = \mathbb{E}|X - y| - \frac{1}{2}\mathbb{E}|X - X'|,$$ where $X, X'$ are i.i.d. distributed according to $d$.

From this definition, and basic properties of random variables, one can derive

$$\lim_{y \rightarrow \infty} d.\mbox{CRPS}(y) - y = -\mathbb{E}[X] - \frac{1}{2}\mathbb{E}|X - X'| = -d.\mbox{mean()} - \frac{1}{2} d.\mbox{energy()},$$

i.e., one can obtain the self-term via taking a limit, if the expressions for CRPS and the expectation are already known.

The cross-term can then be obtained by adding the self-term to the CRPS formula,

$$d.\mbox{CRPS}(y) = d.\mbox{energy}(y) - \frac{1}{2}d.\mbox{energy()},$$

using that CRPS and self-term are known, allowing to obtain the cross-term.

@fkiraly fkiraly added enhancement module:probability&simulation probability distributions and simulators feature request New feature or request good first issue Good for newcomers labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request New feature or request good first issue Good for newcomers module:probability&simulation probability distributions and simulators
Projects
None yet
Development

No branches or pull requests

1 participant