Re: [R] dlm with constant terms

From: Giovanni Petris <GPetris_at_uark.edu>
Date: Wed, 07 May 2008 16:37:02 -0500 (CDT)

> Date: Wed, 07 May 2008 13:03:14 -0400
> From: "Stoyanov, Tsvetan (MSCIBARRA)" <Tsvetan.Stoyanov_at_fea.com>
> Importance: normal
> Priority: normal
> Thread-topic: dlm with constant terms
> Thread-index: AciwZDz3Kl800OdmR4CQkEC8PUECZg==
>
> Hi,
> I am trying to figure how to use dlm with constant terms
> (possibly time-dependent) added to both equations
> y_t = c_t + F_t\theta_t + v_t
> \theta_t = d_t + G_t\theta_{t-1} + w_t,
> in the way that S-PLUS Finmetrics does?
>
> Is there any straightforward way to transform the above to
> the default setup?

I think you can do it by extending the state vector and defining a new dlm with

    \theta^*_t = (1 1 \theta_t')'

    F^*_t = [c_t 0 F_t],

    G^*_t = [1 0 0 ]

            [0    1    0 ]
	    [0   d_t  G_t]

    W^*_t = [0   0   0 ]
            [0   0   0 ]
	    [0   0  W_t]

    m^*_0 = (1 1 m_0)

    C^*_0 = [e 0 0 ]

            [0   e   0 ]
	    [0   0  C_0]

The 'e' on the diagonal of C^*_0 should be zero, but since the matrix must be nonsingular youcan put a very small number, such as e = 1e-8.

Best,
Giovanni Petris

> Thanks,
> Tsvetan
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
>
>

-- 

Giovanni Petris  <GPetris_at_uark.edu>
Associate Professor
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/~gpetris/

______________________________________________
R-help_at_r-project.org 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.
Received on Wed 07 May 2008 - 21:46:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 08 May 2008 - 00:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive