Skip to content
Prev 243821 / 398506 Next

StructTS with 2 seasons

Thanks!

Following Prof. Ripley's reply I inserted the following lines into
StructTS (makeBSM)

if (nf < 3) 
           { ind <- 2L }
        else 
           { ind <- 3:nf
             T[cbind(ind + 1L, ind)] <- 1
           }

This worked and gave me the same variance estimates as the dlm package.


I also see that the StructTS function was updated and can handle 2
seasons now. 

Thanks for the help!

Birgit




I have replreplied that StructI have replaced t to the help from
Giovanni Petris and Brian Ripley


From: 	Giovanni Petris <gpetris at uark.edu>
To:	Birgit Erni <Birgit.Erni at uct.ac.za>
CC:	<r-help at r-project.org>
Date: 	30 November 2010 05:40 PM
Subject: 	Re: [R] StructTS with 2 seasons

Hi Birgit,

You are right, StructTS does not seem to be able to handle a time
series
with frequency 2 (and after a quick glance at the code I suspect a
frequency 3 may not work either).

There are contributed packages that you can use to fit (and smooth,
filter, forecast) structural time series and more general state space
models. Among them I would look at dlm, KFAS, dse, sspir.

HTH,
Giovanni
(author of 'dlm')
On Tue, 2010-11-30 at 10:40 +0200, Birgit Erni wrote:
More
why
have
transition
or
(with
of
at
XP.
e-mai...{{dropped:13}}
http://www.R-project.org/posting-guide.html