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

New functionality: correlated discretized RVs #120

Closed
mnwhite opened this issue Jul 10, 2017 · 10 comments
Closed

New functionality: correlated discretized RVs #120

mnwhite opened this issue Jul 10, 2017 · 10 comments
Assignees
Labels
Dolo Integration Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. Function: Distributions good first issue Simple first issue for new contributors. help wanted
Milestone

Comments

@mnwhite
Copy link
Contributor

mnwhite commented Jul 10, 2017

As is, our only method for automatically generating discretized joint distributions is combineIndepDstns. HARK.utilities should also contain methods for making discrete approximations to correlated multivariate distributions. Three requests:

  1. To start really simple: continuous uniform distribution with linear relationships.

    • In 2D, the graph of the continuous PDF is a parallelogram; the discrete approximation would be approximately a parallelogram but with jagged edges
  2. Discretized multivariate normal distribution. Take in vector array of means and matrix array of varcov, return joint normal approximation.

  3. Same as (2), but lognormal with underlying lognormal distribution as specified.

NB. We plan to move toward a system like that of dolo for discretizing distributions. The best way to do this task might be to figure out how to construct a front end to dolo's existing tools for doing this.

This is related to #119 and #121

@econ-ark
Copy link
Collaborator

econ-ark commented Mar 17, 2018

The math for how to do this for the two-dimensional equiprobable approximation to the normal/lognormal, is at Chris Carroll's public lecture notes site in the MathFacts directory; click on "Equiprobable-Returns". The problem is solved and graphs produced by Mathematica code that is part of an archive here. So a straightforward way to do 2) and 3) would involve translating the Mathematica code to Econ-ARK/HARK flavored python.

@econ-ark econ-ark added the good first issue Simple first issue for new contributors. label Mar 17, 2018
@mnwhite
Copy link
Contributor Author

mnwhite commented Mar 28, 2018

compumetrika's (NMP) comment on #119 is probably more relevant for this issue; I think he was responding to the last line of my original post in that issue.

@llorracc llorracc added the Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. label Apr 25, 2019
@MridulS MridulS added this to the 1.0.0 milestone Aug 24, 2020
@sbenthall sbenthall modified the milestones: 1.0.0, 1.x.y Dec 10, 2020
@sbenthall sbenthall modified the milestones: 1.x.y, 1.0.0 Jan 19, 2021
@sbenthall
Copy link
Contributor

@Mv77

@Mv77
Copy link
Contributor

Mv77 commented Jan 19, 2021

I see this marked as a 1.0.0 milestone, but I have less than a week left and Chris told me to prioritize the calibration stuff.
I might get to it eventually if needed for my dissertation (likely), but that's a bit far down the line.

@sbenthall
Copy link
Contributor

ok, i just moved it because I see that #623 was marked for 1.0.

I guess all this can be punted to 1.x

@sbenthall sbenthall modified the milestones: 1.0.0, 1.x.y Jan 19, 2021
@llorracc
Copy link
Collaborator

Yes, it can be punted. Mateo will indeed need to do it eventually but the calibration stuff nailed down is definitely higher priority.

@sbenthall
Copy link
Contributor

After #640 this will depend on a representation of a correlated multivariate (e.g. lognormal) distribution.

Currently, the LogNormal distribution takes parameters mu and sigma, which may be either floats or lists of floats, and returns an ndarray or list of ndarrays. This is an artifact of earlier implementations. It is moving towards storage of mu and sigma as ndarrays with #811, which is slated for 1.0.

It would make sense for a multivariate lognormal distribution to take an ndarray for the covariance matrix.

You might want to consider at that point making the multivariate lognormal a generalization of the univariate lognormal class, i.e. one that takes a wider range of inputs. The multivariate independent case that is currently supported looks like yet another artifact of now regretted coding.

In my view, it would be ideal if all the inputs and outputs to the Distribution classes were ndarrays and not lists.

@Mv77
Copy link
Contributor

Mv77 commented Feb 10, 2021

It came up before I thought it would. See a first naive attempt at #948.

@llorracc
Copy link
Collaborator

I think Dolo has moved in this direction. Even a univariate distribution is characterized by a (degenerate) variance/covariance matrix.

The issue still arises of "which interpolation method should we use. There are a lot of candidates, and I don't have the to differentiate between them.

@mnwhite
Copy link
Contributor Author

mnwhite commented Jul 3, 2024

@sidd3888 is nearly finished with the multivariate lognormal in #1412 , and multivariate normal was done long ago. I don't think my item (1) in the original post is particularly valuable or useful, and can be done "manually" when needed; it was more of a "getting started" thing. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dolo Integration Expertise: Prob and Stats Needs ready familiarity with advanced undergraduate multivariate probability and statistics. Function: Distributions good first issue Simple first issue for new contributors. help wanted
Projects
Status: Done
Development

No branches or pull requests

7 participants