Symbolic Integration: Explicit integral could not be found

조회 수: 3 (최근 30일)
geeks
geeks 2012년 4월 1일
Hi all,
I got a problem when trying to run a symbolic integration. Since lognormal distribution is not defined in the symbolic tools, I just write it out in an explicit way. The code is as follows:
syms w mu sigma positive
t = (w-6.5)*(w*sigma)^(-1)*(1/sqrt(2*pi)*exp(-(log(w)-mu)^2/sigma^2/2));
c = int(t,w,6.5,inf);
And the error msg is:
Warning: Explicit integral could not be found.
Can anybody please give some hint how to get the integration?
Thanks very much!!
Sonia
  댓글 수: 1
David
David 2012년 10월 22일
Sonia, I had a similar problem and your post really help me, but I do not understand your formula:
(w-6.5).*(w*sigma).^(-1).*(1/sqrt(2*pi)*exp(-(log(w)-mu).^2/sigma^2/2));
could it be: (w-6.5).*(sigma).^(-1).*(1/sqrt(2*pi)*exp(-(log(w)-mu).^2/sigma^2/2));
Is this ok?

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

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 4월 1일
try numeric solution
eg
sigma = .2;
mu = 2;
t = @(w)(w-6.5).*(w*sigma).^(-1).*(1/sqrt(2*pi)*exp(-(log(w)-mu).^2/sigma^2/2));
c = quadgk(t,6.5,inf)
ADD on Geeks comment
use function c
t = @(w,mu,sigma)(w-6.5).*(w*sigma).^(-1).*(1/sqrt(2*pi)*exp(-(log(w)-mu).^2/sigma^2/2));
c = @(mu,sigma)quadgk(@(w)t(w,mu,sigma),6.5,inf)
  댓글 수: 4
Yingying
Yingying 2012년 4월 23일
Can you explain the function C in more detail? I am having the similar problem now, The code is as follows:
>> syms a b y
>> a1=int('1/(a*y^3+b)',y,0,5)
And the msg is:
Warning: Explicit integral could not be found.
a1 =
piecewise([a <> 0 and b = 1 and abs(arg(a)) < pi, 5*hypergeom([1/3, 1], [4/3], (-125)*a)], [Otherwise, int(1/(a*y^3 + b), y = 0..5)])
Walter Roberson
Walter Roberson 2012년 4월 23일
Yingying, for you the easiest solution might be to add assumptions. For example if you know that a > 0 then
syms a positive
syms b y
a1 = int(1/(a*y^3+b), y, 0, 5);
Notice here that I did not quote the expression to be integrated; otherwise the "positive" assumption on "a" would not have any effect.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 4월 1일
limit(-(1/2)*exp(mu+(1/2)*sigma^2)*erf((1/2)*2^(1/2)*(sigma^2-U+mu)/sigma)+(13/4)*erf((1/2)*2^(1/2)*(-U+mu)/sigma)+(1/2)*exp(mu+(1/2)*sigma^2)*erf((1/2)*2^(1/2)*(-ln(13/2)+mu+sigma^2)/sigma)+(13/4)*erf((1/2)*2^(1/2)*(ln(13/2)-mu)/sigma), U = infinity)
Note, in this expression, U is an introduced variable for the purpose of the limit()

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by