triple integral of multivariate gaussian pdf
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!