quasi maximum likelihood: parameter estimation issue

2 ビュー (過去 30 日間)
bing xu
bing xu 2018 年 2 月 2 日
コメント済み: bing xu 2018 年 2 月 3 日
Hi there. thanks for reading first. I got this problem stuck here for few days now, even it seems simple.but.... here is the problem:
I want to use mle function to estimate three parameters(u,phi,syst_sigma) in a customized PDF function. here is the code:
y=[-6.8949 -6.9075 -6.8989 -6.7401 -6.9062];
syms u phi syst_sigma
assume(phi>-1&phi<1);
mi=-1.2704;
measur_sigma=pi^2/2;
h(1)=0;
p(1)=1-phi^2/syst_sigma^2;
t=5;
for t=1:t
h=0.03+phi*h;
v=y(t)-(h+mi);
k=phi.*p/(p+measur_sigma^2);
h=h+k.*v;
p=(phi.*p/(phi-k))+syst_sigma^2;
l=((y(t)-u)^2/p)
P=sum(p)
l=sum((y(t)-u)^2/p)
end
%do the parameter estimation
pdf=@(y,u,phi,syst_sigma) -5/2*log(2*pi)-0.5.*P-0.5.*l;
phat=mle(y(1:end),'pdf',pdf,'start',[0,0.95,0.0]);
t will predefined to a number.I had run the section above '%do the parameter estimation' and it was fine. But after that, it keep come out a lot different error messages. So I come here to see if anyone can help to give some advices. Any comments would be appreciated. Thank you all .
  2 件のコメント
Matt J
Matt J 2018 年 2 月 2 日
When I run your code, I get
Undefined function or variable 't'.
bing xu
bing xu 2018 年 2 月 3 日
Thank you Matt. I re-edit my question.I added t value and few y data on it as well.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2018 年 2 月 3 日
編集済み: Matt J 2018 年 2 月 3 日
%do the parameter estimation
nonsym=matlabFunction(-5/2*log(2*pi)-0.5.*P-0.5.*l);
logpdf=@(y,u,phi,syst_sigma) nonsym(phi,syst_sigma,u);
phat=mle(y(1:end),'logpdf',logpdf,'start',[0,0.95,1],'OptimFun','fmincon');
  1 件のコメント
bing xu
bing xu 2018 年 2 月 3 日
Matt Thank you so much. This really helps me a lot and your code works very well. I thought my code should modified by varargin and varargout but yours seems smarter.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProbability Distributions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by