Clear Filters
Clear Filters

How can I plot the the liklihood Function to show convergence to MLE

1 view (last 30 days)
How can I plot the my Liklihood function for a large n, say at 100, to show MLE convergence (inflection point)? fplot did not work. I used the iterative Newton method to solve via convergence to theta_MLE and would like to graphically display this as well. Thanks for any suggestions.
L_theta=1/16*((1+x1*theta)*(1+x2*theta)*(1+x3*theta)*(1+x4*theta))
fplot(L_theta,[-1,1])

Accepted Answer

Renee Coetsee
Renee Coetsee on 23 Mar 2017
I believe that "fplot" did not work because it is expecting a function handle. Because I am unable to run the code that you provided, I am assuming "L_theta" is an array or scalar value.
Try turning "L_theta" into an anonymous function. Here is an example with input "theta":
L_theta = @(theta) 1/16*((1+x1*theta)*(1+x2*theta)*(1+x3*theta)*(1+x4*theta))
Refer to the documentation page for "fplot" for more function handle examples:

More Answers (0)

Categories

Find more on Just for fun in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!