PS: The ML-calculation in the EFK-function shoud be:
 
return(sum(log(Inno)) + sum(Kerror^2/Inno))
 
instead of Perror, I missed that line while renaming in the version I attached earlier.
 

________________________________

Von: r-sig-finance-bounces@stat.math.ethz.ch im Auftrag von Andreas
Gesendet: Do 24.07.2008 11:46
An: r-sig-finance@stat.math.ethz.ch
Betreff: [R-SIG-Finance] estimating non-linear state space models


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.



As I wrote before, state estimation seems to run OK given the true parameters.



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.



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...



Regards

Andreas






________________________________

Von: Robert Iquiapaza [mailto:rbali@ufmg.br]
Gesendet: Do 24.07.2008 03:21
An: Andreas
Cc: r-sig-finance@stat.math.ethz.ch
Betreff: Re: [R-SIG-Finance] estimating non-linear state space models



Just for those interested. The final version of that paper was published in
Review of Financial Studies 2008 21(1):233-264; doi:10.1093/rfs/hhm049.
Regards

Robert Iquiapaza
ri2162@columbia.edu

--------------------------------------------------
From: "Brian G. Peterson" <brian@braverock.com>
Sent: Wednesday, July 23, 2008 10:03 AM
To: "r_sig_finance" <r_sig_finance@greenmail.ch>
Cc: <r-sig-finance@stat.math.ethz.ch>
Subject: Re: [R-SIG-Finance] estimating non-linear state space models

> Andreas wrote:
>> I am trying to estimate the dynamic model for equity fund's alphas and
>> betas described here:
>> http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740
>> <http://papers.ssrn.com/sol3/papers.cfm?abstract_id=389740>  . The
>> nonlinear state space model is described by equations (6) and (11). (For
>> those in a hurry: The one dimensional state follows an AR1 process. The
>> observation equation has similarities with CAPM, but is extended to
>> depend quadratically on the state)
>>
>> So far I have tried to work with the packages sspir and dse, but they
>> don't seem to support non-linear models. I then tried to implement my own
>> EKF code, it works for state estimation but so far I couldn't get the
>> parameter and variance estimation running reliably.
>
> You might try posting your code here, and being very specific about what
> help you need.  That way everyone can benefit from an implementation of
> these models in R.
>
> Regards,
>
>   - Brian
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



	[[alternative HTML version deleted]]

