Drawing a log likelihood of some distribution
Show older comments
Hello,
Suppose I have a distribution with this pdf:
p*(x==0) + (1-p)*poisspdf(2,x(i))
her log likelihood will be:
Y = SUM from 1:100 (log(p*(x(i)==0) + (1-p)*poisspdf(2,x(i))
x is 1X100 vector sample from this distribution.
I want to plot p as function of Y. meaning, I want to draw the log likelihood of the sample.
p is defined to be p = linspace(0,1,100). p is a probability of course.
I'm trying to use a function handle
for example : f=@(p) but which function sould I write here? if the function was p^2 then I would have wrote f=@(p) p^2 and then plot it but what about this case?
Thank's!
Answers (0)
Categories
Find more on Log Plots 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!