I want a numerical or fast multidimensional integral
Mostra commenti meno recenti
I have the following code:
if true
clc
clear all
close all
tic
syms x1 x2 x3 x4 x5
warning off;
X=[x1-12.568; x2+9.568; x3-11.486; x4-4; x5-0.8];%this is [x-E[x]] matrix.
Cx=[39.4573 0.2350 1.5190 25.6028 1.6754; 0.2350 0.0089 0.0285 0.5958 0.0344;...
1.5190 0.0285 0.2337 1.8325 0.1193; 25.6028 0.5958 1.8325 667.1131 5.5158;...
1.6754 0.0344 0.1193 5.5158 1.3541];%this the covariance matrix.
DeterminantCx=det(Cx)
CxInverse=inv(Cx);%this is the inverse matrix of the covariance matrix (Cx).
DeterminantCxInverse=det(CxInverse)
Xtranspose=transpose(X);
Exponent=Xtranspose*CxInverse*X;
fJointDensity=(1/(sqrt(DeterminantCx)*(2*pi)^(5/2)))*exp(-(Exponent)/2);
I1=int(fJointDensity,x1,-inf,inf);
I2=int(I1,x2,-inf,inf)
I3=int(I2,x3,-inf,inf)
I4=int(I3,x4,-inf,inf)
I5=int(I4,x5,-inf,inf)
t=['Time Elapsed=',num2str(toc), ' sec'];
disp(t)
end
The expected output for I5 is 1, but the problem is that performing the integrations using "int" takes a lot of time. This program is an example of my main problem, but if I can run this program very fast then I can solve my problem.
So I am searching for a numerical integration or a fast integration method.
Thanks a lot.
Hadi.
2 Commenti
John D'Errico
il 16 Mar 2015
You and everyone else recently. Magic does not happen, except for Harry Potter.
Of course, in this problem, the answer is trivial, 1. And while you MIGht be able to reduce the complexity of this problem somewhat, it is impossible without knowing what your limits actually are, or what is the real problem.
Without that information, the simplest answer is to buy a faster computer.
hadi
il 16 Mar 2015
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Eigenvalue Problems in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!