triple integral of multivariate gaussian pdf

3 views (last 30 days)
I want to integrate a function that includes joint gaussian pdf over different intervals, and I first try a simpler case as follows
sigma = [1 0 0; 0 1 0; 0 0 1]; % Cov matrix
theta = 0.001;
F = @(t, m, n) (t^2) * (det(sigma)*(2*pi)^3)^(-0.5) * exp(-0.5*transpose([t; n; m]) * inv(sigma) * [t; n; m]); % objective func
integ = integral3(@(t, m, n) arrayfun(F, t, m, n), -100, 100, -100, 100, -10, 10)/theta^2;
I can get a result of 1.8e-12. However, my goal is to integrate variable n over the interval [-theta*|m|, theta*|m|], so I did the following
sigma = [1 0 0; 0 1 0; 0 0 1]; % Cov matrix
theta = 0.001;
F = @(t, m, n) (t^2) * (det(sigma)*(2*pi)^3)^(-0.5) * exp(-0.5*transpose([t; n; m]) * inv(sigma) * [t; n; m]); % objective func
low = @(m) -theta * abs(m); %lower limit
high = @(m) theta * abs(m); %higher limit
integ = integral3(@(t, m, n) arrayfun(F, t, m, n), -100, 100, -100, 100, low, high)/theta^2;
and matlab says that
Error using @(m)-theta*abs(m) Too many input arguments.
How can I modify the code to integrate over such a coupled interval?

Accepted Answer

Yi Zhou
Yi Zhou on 1 May 2016
ok, i found out that the following seems to work
low = @(t,m) -theta * abs(m); %lower limit
high = @(t,m) theta * abs(m); %higher limit

More Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!