How i can evaluate characteristic function for a random normal vector

23 ビュー (過去 30 日間)
Simone Perotti
Simone Perotti 2023 年 5 月 30 日
コメント済み: Simone Perotti 2023 年 5 月 30 日
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)')

採用された回答

Torsten
Torsten 2023 年 5 月 30 日
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 件のコメント
Simone Perotti
Simone Perotti 2023 年 5 月 30 日
Torsten, thanks so much for your answer. Not only it solved my problem, it also deepened my knowledge of programming and "plotting" in 3d.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by