Hi, I tried to compute an integral in Matlab, but it did not work. I would very much appreciate any help with this!
The function I am integrating is:
f = normpdf(x1, 4, 0.3) * normpdf(x2, 5.6, 0.8) * normpdf(x3, 3.8, 0.5)
The command I used:
int(int(int(f, x3, 0, 5-x1-x2), x2, 0, 5-x1), x1, 0, 5)
Thanks for taking time to help me with this CaptainBlack! As for the questions, yes I have declared x1 x2 and x3 to be symbolic variables (syms x1 x2 x3). Moreover, I am aware that there is no closed form solution for such integral and therefore I thought that Matlab would approximate it numerically itself. So, is there some other function in Matlab I should call in order to estimate the solution numerically? Many thanks!
As for the error function, it reports erf. Here is the report I am getting:
Warning: Explicit integral could not be found.
> In sym.int at 58
ans =
int(int(228359630832953580969325755111919221821239 45984/172635605422472869879069616780005304696582232237*e rf(19/5*2^(1/2))*2^(1/2)*pi^(1/2)*exp(-50/9*x1^2+400/9*x1-2041/18-25/32*x2^2+35/4*x2)-22835963083295358096932575511191922182123945984/172635605422472869879069616780005304696582232237*e rf(-6/5*2^(1/2)+2^(1/2)*x1+2^(1/2)*x2)*2^(1/2)*pi^(1/2)*exp(-50/9*x1^2+400/9*x1-2041/18-25/32*x2^2+35/4*x2),x2 = 0 .. 5-x1),x1 = 0 .. 5)
Many thanks, it is just what I needed! I would have one last question and I will stop bothering you about this problem. Can you please post me some reference on how you computed it? I am familiar with the idea of Monte-Carlo integration (had it in my probability and statistics course) but I don't know how to apply it in Matlab. I searched for it in Help, but did not find anything related.
Cheers,
Didi
This was done in Euler, which is a Matlab like system. There was no special function I just generated a large number of points uniformly distributed over the region of integration and found the average value of the function over the points. I then repeated the process a number of times to estimate the standard error in the integral.
(that is a paraphrase of the actual method but essentially it)
CB