triple integral of multivariate gaussian pdf

3 Ansichten (letzte 30 Tage)
Yi Zhou
Yi Zhou am 29 Apr. 2016
Beantwortet: Yi Zhou am 1 Mai 2016
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?

Akzeptierte Antwort

Yi Zhou
Yi Zhou am 1 Mai 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

Weitere Antworten (0)

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by