Numerically approximate the MLE by evaluating function
1 次查看(过去 30 天)
显示 更早的评论
Enrico Azzini
2019-12-28
回答: Thiago Henrique Gomes Lobato
2019-12-29
Hi!
I have a problem with the following exercice:
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257447/Untitled.png)
I wrote this command but I'm not sure if it's correct, for example the interval is different because -10 belongs to the interval...Someone could help me please?
Thank you!
x=[-10:0.02:10]
y=exp(-(x-1).^2./2)+3.*exp(-(x-2).^2./2)
plot(x,y)
0 个评论
采纳的回答
Thiago Henrique Gomes Lobato
2019-12-29
If you want to make sure -10 is not in the interval and still get equidistant points you could do something like this (it actually doesn't matter in this example since there's no discontinuity):
x=linspace(-9.9999,10,1000);
y=exp(-(x-1).^2./2)+3.*exp(-(x-5).^2./2);
plot(x,y)
Otherwise everything seems fine with except of the mean in the second equation that you wrote -2 and not -5 as in the command. This is basically the sum of two gaussians with same variance and mean 1 and 5 where the second one has a bigger weighting.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!