views:

147

answers:

1

I have a function which I know to be a multivariate distribution in (x,y), and mathematica is having numerical stability issues when I form the marginal distributions.

For example, marginalizing along y yields the following: 0.e^(154.88-0.5x^2)

Since I know the result must be a distribution, I would like to extract just the e^(-.5x^2) and do a renormalization myself. Alternatively, it would be even nicer if mathematica would let me take a multivariate function and somehow specify it as a probability distribution.

Anyway, does anyone know how to implement either of the above two solutions programatically?

A: 

Ok, here's an example of what I mean. Suppose I have the following 2D distribution:

Dist = 
3.045975040844157` E^(-(x^2/2) - y^2/
2) (-1 + E^(-1.` (x + 0.1` y) UnitStep[x + 0.1` y]))^2

And I attempt to

Integrate[Dist, {y, -Infinity, Infinity}]

Mathematica does not provide an answer, or at least doesn't do so for quite a while on my computer. Suggestions?

Edit: ok, so it actually does, but takes 5 minutes on my Intel i5 with 4GB ram... I am still hoping theres some way to tap into Mathematica's built in distribution type (though it seems to be single variable only) and make use of their RandomReal[dist]. The best I could hope for is if Mathematica would let me specify this 2D function as a distribution, and be able to call RandomRealVector[dist].

casdf