# How to integrate out a function parameter

Given the function

$$\int\int p(x|a,b)p(a)p(b) \, d(a) \, d(b)$$

I would like to integrate out $a$ and $b$ to be left with $x$ only. As far as numeric methods go, I understand how to do it, but is there a computational approach to it? By that I mean an algorithm you could encode on a computer that would approximate that?

I was thinking about a simpler example

$$\int p(x|a) p(a) \, d(a)$$

and thought to take $N$ $x$ values , let's say $\langle 1,2,3,\ldots,N\rangle$ and integrate for a fixed $x$, all values of $a$. In a sense, I change the function to be in terms of a and not $x$, to get back to univariate function. Then, I can combine it using some interpolation to make approximately continuous $p(x)$. Is that a good approach?

-
Perhaps I'm a bit dense, but I'm not seeing what you intend $p(x|a,b)$ to mean. I would interpret that as a the probability of $x$ conditioned on $a,b$, but given the rest of your question, I don't think that's what you meant. Could you be more specific/expand your notation a bit? –  Drew Christianson Jun 1 '12 at 17:07
Using this same letter in this context to denote several different functions has always irritated me. –  Michael Hardy Jun 1 '12 at 18:00