![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1670131/image.png)
How to find closed form solution involving a sum over sample data
5 views (last 30 days)
Show older comments
I am trying to find closed form solutions for various distributions with left-truncated data, i.e. I have to maximize the likelihood function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829130/image.png)
Finding a solution to this optimization problem numerically has proven difficult for me so I was hoping I might be able to just find a closed form solution. Is there a way in Matlab to just sum over some "n numbers", the value of which is in some range (i.e., > 0, < 50, etc.), and to then find a solution to some equation containing such a term?
Thank you for your help!
0 Comments
Answers (1)
Nipun
on 16 Apr 2024
Hi Jan,
I understand that you want to get the closed form solution of the given summation (the likelihood function) in MATLAB.
MATLAB does support closed form solutions to many ODEs and symbolic math equations. For closed form of "summation of polynomial series", refer to the MathWorks documentation below:
However, in the given summation, the function "f(x)" is unknown. Therefore, it is not possible to get a closed form solution for this expression unless "f(x)" is explicitly stated.
Nonetheless, one can use the property of logarithms to compress the summation of logs to log of products. The final expression achieved is as under:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1670131/image.png)
Hope this helps.
Regards,
Nipun
0 Comments
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!