How to find the minimum value of an integral using Matlab?

조회 수: 6 (최근 30일)
Yufei Cao
Yufei Cao 2019년 10월 4일
댓글: Walter Roberson 2019년 10월 6일
I want to find the θ value, which makes takes the minimum value. is given by
,
where is a known function, and is the PDF of Student's t distribution.
I am not sure: (1) how to convert this equation into Matlab language, and (2) which Matlab function is the best to find the minimum value in general?
  댓글 수: 2
Dimitris Kalogiros
Dimitris Kalogiros 2019년 10월 4일
편집: Dimitris Kalogiros 2019년 10월 4일
The minimume value with respect to what parameter? Theta I guess... am I right ?
Yufei Cao
Yufei Cao 2019년 10월 5일
Yes. I want to find the value theta which minimize the function f(theta).

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 5일
편집: Walter Roberson 2019년 10월 5일
The critical points of a function (max, min, saddle points) are where the derivative of the function are 0. But you have the derivative: it is the part inside the integral.
If f(x) is not infinite then one zero occurs when theta is -inf*sign(g(x)) as that makes exp(-inf)*f(x) which is 0*f(x) which is 0 when f(x) is finite.
There are also solutions wherever f(x) is 0 independent of finite theta*g(x), but f(x)=0 with g(x) infinite and theta the same sign as g(x) would lead to infinity times 0 which is undefined.
There are also solutions whenever g(x) is infinite and f(x) is finite, in which case theta = arbitrary positive times -sign(g(x)) again leads to 0
If g(x) is finite and f(x) is non-zero and theta is restricted to be finite, then you can be sure that the expression is non-zero and so not a critical point.
You can see that the only one of these that is dependent on specific value of theta is the infinite case. Therefore choose -inf*sign(g(x)) after which you just have to go through and find the infinite f(x) to remove those from the solution set.
  댓글 수: 2
Yufei Cao
Yufei Cao 2019년 10월 6일
편집: Yufei Cao 2019년 10월 6일
Hi, Walter, thanks for your reply.
After reading your method, I am confuesd with in the case that when theta takes -inf*sign(g(x)). For example, let X be a Gaussian random variable. Its moments generating function is:
Following your method without sovling the integral, I think takes the minimum value when θ is -inf*sign(x). Am I right? How to use your method to analyse the above equation in a proper way?
Walter Roberson
Walter Roberson 2019년 10월 6일
Examine what is being integrated, and notice that for real-valued theta, exp(theta*x) can never be negative, and exp(-x^2/2) can also never be negative. Therefore the minima of the integral can never be negative. Can the minima of the integral be 0?
Potentially it can be -- if theta is permitted to be a function of x rather than a constant. If it can be a function of x then let theta be -inf*sign(x) . It is being multipled by x, so you get -inf*sign(x)*x . For negative x that would be -inf * -1 * a negative value, which would be a triple negative that would multiply out to -inf and exp(-inf) is 0. For positive x, it would be -inf * 1 * a positive value, which is a single negative, which would multiply out to -inf and exp(-inf) is 0.
But what if you require theta to be a constant? If you set it to inf then for the negative values the inf times negative would give -inf and exp(-inf) is 0. However, with inf then for the postiive values of x, inf times positive would give +inf and exp(+inf) is +inf and you now have an infinite integral. If you try theta = -inf then the bottom half is +inf and the top half is 0. Therefore if theta is to be constant it cannot be either -inf or +inf . But potentially it could be 0, which would give exp(0*x) which would be exp(0) which is 1.
If you do the integral you posted here for H(0) assuming constant theta, then it turns out to be exp(theta^2/2) which obviously has a minima when theta is 0.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by