<HTML dir=ltr><HEAD><TITLE>Re: [R-SIG-Finance] estimating non-linear state space models</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText26976 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN-US">I had to clean up my EKF code first, after trying many different ideas I ended up with a huge mess... It's still heavily under development, but I think it could serve as a starting point.</SPAN><SPAN lang=EN-US style="mso-ansi-language: EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US">As I wrote before, state estimation seems to run OK given the true parameters.</SPAN><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US">When I try to estimate the parameters by maximizing the likelihood, I end up with rather random results depending on the initial parameters I start optimizing with.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US">I don’t know if there’s an error in the calculation of the likelihood, or if I’m just overstraining the ML-method by estimating model parameters and noise variances at the same time. Is this even possible? Or maybe I’m just expecting too precise results…<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US">Regards<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US">Andreas</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US"></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-US"></SPAN></FONT><FONT face=Arial size=2></FONT> </P></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> Robert Iquiapaza [mailto:rbali@ufmg.br]<BR><B>Gesendet:</B> Do 24.07.2008 03:21<BR><B>An:</B> Andreas<BR><B>Cc:</B> r-sig-finance@stat.math.ethz.ch<BR><B>Betreff:</B> Re: [R-SIG-Finance] estimating non-linear state space models<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Just for those interested. The final version of that paper was published in<BR>Review of Financial Studies 2008 21(1):233-264; doi:10.1093/rfs/hhm049.<BR>Regards<BR><BR>Robert Iquiapaza<BR>ri2162@columbia.edu<BR><BR>--------------------------------------------------<BR>From: "Brian G. Peterson" <brian@braverock.com><BR>Sent: Wednesday, July 23, 2008 10:03 AM<BR>To: "r_sig_finance" <r_sig_finance@greenmail.ch><BR>Cc: <r-sig-finance@stat.math.ethz.ch><BR>Subject: Re: [R-SIG-Finance] estimating non-linear state space models<BR><BR>> Andreas wrote:<BR>>> I am trying to estimate the dynamic model for equity fund's alphas and<BR>>> betas described here:<BR>>> <A href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740">http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740</A><BR>>> <<A href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740">http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740</A>> . The<BR>>> nonlinear state space model is described by equations (6) and (11). (For<BR>>> those in a hurry: The one dimensional state follows an AR1 process. The<BR>>> observation equation has similarities with CAPM, but is extended to<BR>>> depend quadratically on the state)<BR>>><BR>>> So far I have tried to work with the packages sspir and dse, but they<BR>>> don't seem to support non-linear models. I then tried to implement my own<BR>>> EKF code, it works for state estimation but so far I couldn't get the<BR>>> parameter and variance estimation running reliably.<BR>><BR>> You might try posting your code here, and being very specific about what<BR>> help you need. That way everyone can benefit from an implementation of<BR>> these models in R.<BR>><BR>> Regards,<BR>><BR>> - Brian<BR>><BR>> _______________________________________________<BR>> R-SIG-Finance@stat.math.ethz.ch mailing list<BR>> <A href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</A><BR>> -- Subscriber-posting only.<BR>> -- If you want to post, subscribe first.<BR>><BR></FONT></P></DIV></BODY></HTML>