Integration of the expected value
조회 수: 10(최근 30일)
I have an interval and an expected price which is laying on this interval. b is a constant.
I want to find all possible values of expected profit function which is expressed as and plot it.
is a c.d.f. of uniformly distrtubited density function .
Integrating by parts the expected price can be re-written as: . So, I am trying to write the following code, which doesn't work:, please see below. Any help will be highly apprerciated!
b = 1;
p = (0:0.01:b);
p_e = (p:0.01:b);
pd1 = makedist('Uniform','lower',p,'upper',b);
G = @(p) p + p * cdf - int((cdf), p, p, b);
leg = legend('Expected profit','AutoUpdate','off');
% put the grid on top of the colored area
set(gca, 'Layer', 'top')
William Rose 2022년 8월 2일
I'm not sure I understand. Is a uniformly distributed random variable, or is the expected value of p, which is a uniformly distributed random variable? You wrote inside the integral in the first equation, but after that, the subscript e disappeared. If is the random variable inside the integral, then it should be the vrable of integration, so the integral should have been . If that is the case, then you have
where b and p are constants. Which is just what you expect for the mean value of a uniformly distributed random variable.
Perhaps you meant to write for the first equation. If so, there is a different problem, which is that p cannot be the lower limit of integration and the variable of integration at the same time.