Kippeum Lee
Kippeum Lee

Reputation: 1

Integrals of multiple variables with some of the limits depending on variables (Julia)

Suppose that there is data on J variables, Y_1, Y_2,..., Y_J, drawn from multivariate normal distribution. I am trying to calculate the marginal cdf of Y_1 conditional on Y_1>=Y_2>=...>=Y_J. While I'm doing this, I need to do integration over Y_1,...,Y_J with ranges [-inf,y] for Y_1, [-inf, Y_1] for Y_2, ..., [-inf, Y_J-1] for Y_J.

What I am currently doing is to create many inner integrals and do it sequentially. But I want to make it flexible for the order of Ys or calculating the marginal cdf of Y_j. Is there any easier way to do integrals of multiple variables with some limits depending on variables?

Upvotes: 0

Views: 70

Answers (1)

SGJ
SGJ

Reputation: 1058

One option, if you are using a package like HCubature.jl or Cuba.jl that does integration over hyper-rectangle domains, is simply to do a change of variables that maps your domain to a rectangle. See, for example, this Julia discourse post.

Alternatively, there is a package IteratedIntegration.jl to do nested integrals more efficiently.

Upvotes: 0

Related Questions