Calculating the expected value of a transformed random variable in MATLAB?

ⅰ亾dé卋堺 提交于 2019-12-11 13:48:53

问题


I am trying to compute the following expected value for Z being lognormally distributed

E[Z^eta w(F_Z (Z))^-eta]

where eta is a real number, F_Z the distribution function of Z and w:[0,1]->[0,1] an increasing function.

First of all, I am pretty new to Matlab so I don't know which way of integrating is the better one, numerically or symbolically. I tried symbolically.

My idea was to subsequently define functions:

syms x;
g_1(x) = x^eta;
g_2(x) = logncdf(x);
g_2(x) = w(x)^-eta;
g_4(x) = g_1(x) * g_3(g_2(x));

And then

exp = int(g_4(x),x,0,inf)

Unfortunately this doesn't work and MATLAB just posts the whole expression of g_4...

Is it better to use the numerical integration quadqk? What am I doing wrong here? I already read something about MATLAB not being the best program for integration but I have to use it so switching to a different program does not help.

Thanks a lot!

来源:https://stackoverflow.com/questions/24761176/calculating-the-expected-value-of-a-transformed-random-variable-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!