How i can evaluate characteristic function for a random normal vector

40 vues (au cours des 30 derniers jours)
I want to numerically evaluate characteristic functions (ChF) of PDF
For example, the ChF of the Multi-Normal distribution is
where is the ChF variable (vector), is the distribution mean (vector), is its variance-covariance matrix and i is the imaginary unit.
If I numerically construct a normal distribution and the ChF as below, how could I numerically estimate its characteristic function and then plot in a 3d plot the real part and the imaginary part?
I think i have to pass to the anonymous function a matrix if I want to evaluate the vector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ChF of X(w) K-dimensional normal(MU,SIGMA)
%
% X real stochastic vector
%
% MU = [ mu_1 ]
% [ mu_2 ]
%
% SIGMA = [ sigma_1*sigma_1 rho*sigma_1*sigma_2 ]
% [ rho*sigma_1*sigma_2 sigma_2*sigma_2 ]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear variables
close all
clc
i = complex(0,1);
% mean vector
mu_1 = 10;
mu_2 = 5;
MU = [mu_1; mu_2];
% var-covar matrix
rho = 0.3;
sigma_1 = 1;
sigma_2 = 0.5;
SIGMA = [sigma_1*sigma_1, rho*sigma_1*sigma_2;...
rho*sigma_1*sigma_2, sigma_2*sigma_2];
% ChF function
chf = @(t) exp(i * transpose(t) * MU - 0.5 * transpose(T) * SIGMA * t );
% plot ChF
figure(1)
t = linspace(0,5,250);
chfVAL = chf(t);
plot3(t,real(chfVAL),imag(chfVAL),'linewidth',2)
grid on
title('Characteristic function')
xlabel('t')
ylabel('real(ChF)')
zlabel('imag(ChF)')

Réponse acceptée

Torsten
Torsten le 30 Mai 2023
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ChF of X(w) K-dimensional normal(MU,SIGMA)
%
% X real stochastic vector
%
% MU = [ mu_1 ]
% [ mu_2 ]
%
% SIGMA = [ sigma_1*sigma_1 rho*sigma_1*sigma_2 ]
% [ rho*sigma_1*sigma_2 sigma_2*sigma_2 ]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear variables
close all
clc
i = complex(0,1);
% mean vector
mu_1 = 10;
mu_2 = 5;
MU = [mu_1; mu_2];
% var-covar matrix
rho = 0.3;
sigma_1 = 1;
sigma_2 = 0.5;
SIGMA = [sigma_1*sigma_1, rho*sigma_1*sigma_2;...
rho*sigma_1*sigma_2, sigma_2*sigma_2];
% ChF function
chf = @(t) exp(i * transpose(t) * MU - 0.5 * transpose(t) * SIGMA * t );
% plot ChF
figure(1)
[X,Y] = ndgrid(linspace(-10,20,2500),linspace(-10,20,2500));
chfVAL = arrayfun(@(X,Y)chf([X;Y]),X,Y);
surf(X,Y,real(chfVAL))
shading interp
colorbar
  1 commentaire
Simone Perotti
Simone Perotti le 30 Mai 2023
Torsten, thanks so much for your answer. Not only it solved my problem, it also deepened my knowledge of programming and "plotting" in 3d.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by