Help understanding multivariate rv_discrete in the multivariate case
Giovanni Pugliese Carratelli <[email protected]> Thu, 29 Oct 2020 18:45:46 +0000
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <LNXP265MB166036CDFABE91FE9464255FA6140@LNXP265MB1660.GBRP265.PROD.OUTLOOK.COM> |
Hello,
I have just been trought the documentation for scipy's rv_discrete function. In particular I am interested in creating a discrete support multivariate rv from values I provide.
From the documentation<https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_discrete.html> it appers that it is possible only for a list of values.
So I have come up with the code:
a = [[1/6, 1/6, 1/6], [1/6, 1/6, 1/6]]
#print(np.shape(a))
xks=[[1,2,3],[1,2,3]];
joint = stats.rv_discrete(name='Joint', values=(xks, a));
Is this correct?
Moreover, how can I use "expect" now that the rv is multidimensional? I would need for instance to compute the expectation along only of the dimensions, or simply marginalise.
I have tried stackexchange to no avail.
_______________________________________________
SciPy-User mailing list
[email protected]
https://mail.python.org/mailman/listinfo/scipy-user