Probability finding the characteristics

Hello What should I add to this code to Evaluate the characteristic function of 𝛷𝑌(𝜔) and plot |𝛷𝑌(𝜔)|.
% initialising given data :
a = 38 ; b = 150 ; mean_x = 90 ; var_x = 40 ;
% defining sample space :
N = 1000 ; x = linspace (a,b,N) ;
% defining the normal distribution :
f = @(x) (1/(var_x * sqrt(2*pi))) * exp(-0.5*((x - mean_x)/var_x).^2) ;
% defining the cumulative normal distribution :
F = @(x) integral(f,-inf,x) ;
% defining the truncated normal distribution :
ft = @(x) f(x)/(F(b)-F(a)) ;
% calculating the data points :
f_data = f(x) ; % normal distribution ft_data = ft(x) ; % truncated distribution
% plotting the data points : plot(f_data , x); % plotting normal distribution (the blue one) hold on plot(ft_data , x); % plotting truncated distribution (the red one) hold off
% finding the equation for first moment of the truncated distribution : m_1 = @(x) (ft(x)).*(x) ; M_1 = integral (m_1,a,b)
% finding the equation for second moment of the truncated distribution : m_2 = @(x) (ft(x)).*(x.^2) ; M_2 = integral (m_2,a,b)
% finding the equation for third moment of the truncated distribution : m_3 = @(x) (ft(x)).*(x.^3) ; M_3 = integral (m_3,a,b)
% finding the equation for forth moment of the truncated distribution : m_4 = @(x) (ft(x)).*(x.^4) ; M_4 = integral (m_4,a,b)
% finding the equation for fifth moment of the truncated distribution : m_5 = @(x) (ft(x)).*(x.^5) ; M_5 = integral (m_5,a,b)
% finding the variance of the truncated distribution with the help of first and second moments : var_t = M_2 - (M_1).^2
% defining new limits : A = a.^2 ; B = b.^2 ;
% defining new sample space : y = x.*(x);
% plotting the new PDF : plot(f(y),y);
% finding the first moment : my_1 = @(y) (f(y)).*(y) ; My_1 = integral (my_1,A,B)
% finding the first moment : my_2 = @(y) (f(y)).*(y.^2) ; My_2 = integral (my_2,A,B)
% finding the first moment : my_3 = @(y) (f(y)).*(y.^3) ; My_3 = integral (my_3,A,B)

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by