How do I apply iteration method to an integral?

조회 수: 6 (최근 30일)
Angie
Angie 2024년 5월 6일
댓글: Angie 2024년 5월 10일
Hello everyone,
I need to code an equation. That equation includes a new parameter that is not in my data, and therefore the parameter needs to be estimated/calculated before I can proceed.
There is a formula for the parameter, and the formula includes an integral, with the lowest limit being exactly that parameter I am trying to estimate. Therefore, that parameter is both on the left and on the right side of the equation. I am trying to figure out how to do it.
I think I understand the general idea. I need to use iterative method: make an initial guess, write a loop with the formula and it will converge to some value, which will be the final answer (please let me know if I am wrong)
I can’t figure out the steps I need to do. I’ve tried multiple things, but I couldn’t get it to run.
Here’s the formula:
  • cdf is stored in stp.F;
  • alpha is stored in mod.alpha;
  • vector with q values : mod.vecq.
Could you please help me or give me some pointers? Thank you in advance.

채택된 답변

Alan Stevens
Alan Stevens 2024년 5월 6일
Look up help on function fzero.
  댓글 수: 4
Alan Stevens
Alan Stevens 2024년 5월 10일
Good!
(We can't actually run your code as we don't have access to mod, stp and pinf.)
Angie
Angie 2024년 5월 10일
Yes of course, I understand. But if at some point in the future someone has their own values and is looking for a solution to a similar problem hopefully the code can help them to move in the right direction. Thank you again, your pointer saved me a lot of headache :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by