I want to compute the expected value of a multivariate function f(x) wrt to dirichlet distribution. My problem is "penta-nomial" (i.e 5 variables) so calculating the explicit form of the expected value seems unreasonable. Is there a way to numerically integrate it? Is there some package (e.g in R) that can let me do that? I realize I can solve it using first principle but I want the computation to be really fast.

f(x) = \sum_{0,4}(q_i*log(n/q_i))
  • $\begingroup$ Why is your region non-rectangular? $\endgroup$
    – nicoguaro
    Oct 12, 2014 at 15:36
  • $\begingroup$ Because the probability distribution is dirichlet and so the constraint that sum of probabilities should be one makes it non rectangular... That correct right? $\endgroup$
    – Bob
    Oct 12, 2014 at 18:01
  • $\begingroup$ I see, this distribution us defined over a simplex (I didn't know that). One option is to use a Gauss quadrature over your simplex, like [here]( mathworks.com/matlabcentral/fileexchange/…). Also, see this [question] ( scicomp.stackexchange.com/questions/2013/…). $\endgroup$
    – nicoguaro
    Oct 12, 2014 at 18:11
  • $\begingroup$ you could use stochastic integration as long as you knew what the domain was. Randomly select a point and determine whether it is in the parcel of the integral or not, within the hyper-rectangle. You know the volume of the hyper-rectangle, and as your point-count gets high enough, you have the ratio of "in" to "out". Multiply the volume by the ration to get the estimated volume of your sub-parcel. $\endgroup$ Jul 7, 2015 at 4:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.