How can I calculate the moments of an exponential random variable

조회 수: 1 (최근 30일)
Jaime De La Mota Sanchis
Jaime De La Mota Sanchis 2022년 9월 14일
댓글: Torsten 2022년 9월 14일
Hello everyone.
I am working in an aplication related to polynomial chaos expansions. For that, I need to calculate the analytic moments of the following random variable
pd = makedist('Exponential', 3)
t = truncate(pd,0,5)
rand_num=random(t, 100000000, 1);
However, I have no idea on how to do it. Can someone please give me a clue?
Best regards.
Jaime.

답변 (1개)

Torsten
Torsten 2022년 9월 14일
편집: Torsten 2022년 9월 14일
syms mu x lower upper n
assume(n,'integer')
assume(n>0)
lower = 0;
upper = 5;
mu = 3;
f = 1/mu*exp(-x/mu) / int(1/mu*exp(-x/mu),x,lower,upper)
f = 
fplot(f,[0 5])
%Check
int(f,x,lower,upper)
ans = 
1
%Moments
moments = int(f*x^n,x,lower,upper)
moments = 
  댓글 수: 2
Jaime De La Mota Sanchis
Jaime De La Mota Sanchis 2022년 9월 14일
편집: Jaime De La Mota Sanchis 2022년 9월 14일
Thank you very much for the help. Is there a way to do this with other random variables?
Torsten
Torsten 2022년 9월 14일
Sure, you only need the PDF of the distribution and the fact that an analytical expression for the moments exists.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by