I am looking for a Kalman filter that can handle a control input. I thought that l.SS was suitable however, I can't get it to work, and wonder if I am not using the right function. What I want is a Kalman filter that accepts exogenous inputs where the input is found using the algebraic Ricatti equation solution to a penalty function. If K is the gain matrix then the exogenous input would be u_t = -Kx_n, where x_n is the Kalman filter state estimate. These inputs would be entered as such x_t = Ax_t-1 + Bu_t-1 + Ge_t. Is l.SS in the dse1 package the correct parametrization of the Kalman filter? Thank you very much, Todd Remund
you have to be really careful because There are two versions of the kalman filter in terms of notation ( even where you don't have exogenous ) Y_t = F_tprime*theta_t-1 + epsilon_t G_t = G_t*theta_t-1 + omega_t ----------------------------------------- Y_t = F_tprime*theta_t + epsilon_t G_t = G_t*theta_t-1 + omega_t I haven't looked at any of the kalman filter routines ( there something in the base KalmanLike, dlm package Has one and I guess dsel and probabyl others ) but I think hey usually explain which notation they are using. The two variations above derive different recursions but you get the same answer at each step as long as you estimate the variances consistently depending on the framework. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Todd Remund Sent: Wednesday, December 20, 2006 12:19 PM To: r-help at stat.math.ethz.ch Subject: [R] Kalman Filter in Control situation. I am looking for a Kalman filter that can handle a control input. I thought that l.SS was suitable however, I can't get it to work, and wonder if I am not using the right function. What I want is a Kalman filter that accepts exogenous inputs where the input is found using the algebraic Ricatti equation solution to a penalty function. If K is the gain matrix then the exogenous input would be u_t = -Kx_n, where x_n is the Kalman filter state estimate. These inputs would be entered as such x_t = Ax_t-1 + Bu_t-1 + Ge_t. Is l.SS in the dse1 package the correct parametrization of the Kalman filter? Thank you very much, Todd Remund ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
Todd Remund wrote:> I am looking for a Kalman filter that can handle a control input. I thought > that l.SS was suitable however, I can't get it to work, and wonder if I am > not using the right function. What I want is a Kalman filter that accepts > exogenous inputs where the input is found using the algebraic Ricatti > equation solution to a penalty function. If K is the gain matrix then the > exogenous input would be u_t = -Kx_n, where x_n is the Kalman filter state > estimate. These inputs would be entered as such x_t = Ax_t-1 + Bu_t-1 + > Ge_t.The control input u for l.SS in dse must be specified as (multivariate) series (i.e. all periods) in the call to l.SS. So the input does not really permit a control (feedback) rule like you seem to have in mind, unless you are thinking of the steady state solution to the Ricatti equation. However, it does look like this might be specified in the gain matrix as part of the state feedback, rather than as an input. (BTW, your situation is one where the widely used term "exogenous" is clearly incorrect, thus my preference for calling this "input".) Another (inefficient) possibility would be to iterate to a solution.>Is l.SS in the dse1 package the correct parametrization of the Kalman > filter?I think it is correct, following some of the classic references. However, as Mark Leeds pointed out, there are different conventions. (I think, actually, more than two even without considering the input series.) The dse specification is a bit special regarding the input, in that the input is shifted so that time t can feed through to the state and affect the output in the same period t. This is important in some economics application, especially at annual frequencies. Others solve this problem by having inputs bypass the state and feed directly through to the output, in which case the state no longer summarizes the dynamics of the process, and is not a state vector in the classic sense. Paul Gilbert> > Thank you very much, > Todd Remund > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.=================================================================================== La version fran?aise suit le texte anglais. ------------------------------------------------------------------------------------ This email may contain privileged and/or confidential inform...{{dropped}}