QuantEcon / QuantEcon/Expectations.jl

[feature request] Generic fallback for non-supported distributions ?

Open
#67 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
61
Forks
15
PR merge metrics
No merged PRs in 30d

Description

It would be neat if there was a generic fallback for non-supported distributions. I can come up with a simple solution for continuous distributions:

# fallback for UnivariateContinuousDistribution
import Cubature
pcubature(x * Distributions.pdf(X,x), minimum(X), maximum(X))

but i need to think a bit more for discrete infinite supports.

Edit: There is ageneric fallback in Distributions.jl implemented there: https://github.com/JuliaStats/Distributions.jl/blob/master/src/functionals.jl

So maybe this is just an interface issue, Expectations.jl should not throw when it does not know the distribution but simply use the Distributions.jl one. Thanks @devmotion for the link.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Distributions.jl's src/functionals.jl, which the issue identifies as having a generic fallback, then inspect how Expectations.jl handles unsupported distributions. Compare the continuous and discrete-support cases described here. Done means unsupported distributions use the appropriate generic behavior instead of raising the current interface error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.