QuantEcon.jl
QuantEcon.jl copied to clipboard
Add code for a multivariate discrete random variable
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.
Codecov Report
Merging #204 into master will decrease coverage by
0.1%
. The diff coverage is78.57%
.
@@ 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.
Just throwing this out there -- would it be better to replace the q
and Q
fields with an instance of DiscreteRV
on vec(q)
?