Skip to content

Independence and marginals in DiscreteDistribution  #1114

@Mv77

Description

@Mv77

This is not an issue or bug, but rather a desired feature that I think would make our lives easier and more elegant.

It would be useful if multivariate discrete distributions had:

  1. A property telling us whether its dimensions are independent.
  2. A method to extract joint distributions of subsets of its dimensions. E.g., if I have the joint distribution of permanent shocks to income, transitory shocks to income, and risky returns ShkDstn, it would be useful to be able to do something like InkShkDstn = ShkDstn.marginal(dims=[0,1]).
  3. A method to determine whether its dimensions are independent. Since we are dealing with discrete distributions, this should be easy.

What is the value of all this?
1. Redundancy reduction: IndShockConsumerType currently tracks IncShkDstn, TranShkDstn, and PermShkDstn. It'd be good if we kept track of a single object.
2. In-code determination of the methods/speedups that can be used: Harmenberg's method works only if permanent shocks are independent from all other shocks (I think); a portfolio problem can be solved much more quickly if the return factor is independent of other shocks. Currently we ask the user to tell us whether these things are true with arguments like IndepDstnBool. If would be good if the user could simply give us a joint distribution of shocks and we figured out the rest.
3. The above point would help to reduce hard-coded features and make things more modular: IndShockConsumerType knows its shocks are independent because we have hard-coded its income process. If we want to move towards a world where we can pass an income distribution constructed elsewhere, we have to be able to determine the properties of that distribution, for the reasons above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Not started

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions