QuantEcon.jl icon indicating copy to clipboard operation
QuantEcon.jl copied to clipboard

Add code for a multivariate discrete random variable

Open cc7768 opened this issue 7 years ago • 2 comments

This code is very similar to the code that is in the QE.jl library for DiscreteRV.

We could simply treat multivariate discrete random variables as a univariate discrete random variable (and just make everything long vectors), but that requires working with conversions between linear and cartesian indexing. It also simplifies the interpretation of joint distributions.

This mostly mimics the code from DiscreteRV and adds a call to ind2sub so that it does the conversions for you.

cc7768 avatar Feb 21 '18 18:02 cc7768

Codecov Report

Merging #204 into master will decrease coverage by 0.1%. The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   91.12%   91.01%   -0.11%     
==========================================
  Files          24       24              
  Lines        1712     1726      +14     
==========================================
+ Hits         1560     1571      +11     
- Misses        152      155       +3
Impacted Files Coverage Δ
src/discrete_rv.jl 86.95% <78.57%> (-13.05%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9334727...d8798d5. Read the comment docs.

codecov-io avatar Feb 21 '18 18:02 codecov-io

Just throwing this out there -- would it be better to replace the q and Q fields with an instance of DiscreteRV on vec(q)?

sglyon avatar Feb 21 '18 19:02 sglyon