How i can evaluate characteristic function for a random normal vector

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)')

 채택된 답변

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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

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개)

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

질문:

2023년 5월 30일

댓글:

2023년 5월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by