[R] TV VECM (formerly: VECM with UNRESTRICTED TREND)

From: Pfaff, Bernhard Dr. <Bernhard_Pfaff_at_fra.invesco.com>
Date: Fri, 01 Apr 2011 09:21:52 +0100

Dear Renoir,

are you referring to:

        http://econ.la.psu.edu/~hbierens/TVCOINT.PDF

?
If so, no, but you could up this framework fairly easily and hereby employ the functions of urca. But this should already be evident from the package's manual.

Best,
Bernhard

> -----Ursprüngliche Nachricht-----
> Von: renoir vieira [mailto:renoirvieira_at_gmail.com]
> Gesendet: Donnerstag, 31. März 2011 22:27
> An: Grzegorz Konat
> Cc: Pfaff, Bernhard Dr.; r-help@r-project.org
> Betreff: Re: [R] VECM with UNRESTRICTED TREND
>
> Dear Pfaff,
>
> Would that be possible to fit a Time varying VECM using urca?
>
> Yours,
> Renoir
>
> On Thursday, March 31, 2011, Grzegorz Konat
> <grzegorz.konat_at_ibrkk.pl> wrote:
> > The code you gave me works fine with Finland, but the same
> for my data
> > - does not!
> > I do:
> >
> > library(urca)
> > data(my.data)
> > dat1 <- my.data[, c("dY", "X", "dM")]
> > trend <- matrix(1:nrow(dat1), ncol = 1)
> > colnames(trend) <- "trd"
> > yxm.vecm <- ca.jo(dat1, type = "trace", ecdet = "const", K
> = 2, spec =
> > "longrun", dumvar = trend)
> >
> > and the result is again:
> >
> > Error in r[i1, , drop = FALSE] - r[-nrow(r):-(nrow(r) - lag
> + 1L), ,
> > drop = FALSE] :
> >  non-numeric argument to binary operator
> >
> > I attach my dataset in xls format. If you have 5 minutes
> and wish to
> > check it out, I'd be extremely grateful!
> >
> > Best,
> > Greg
> >
> >
> >
> > 2011/3/31 Pfaff, Bernhard Dr. <Bernhard_Pfaff_at_fra.invesco.com>
> >
> >>  Well, without further information, I do not know, but try the
> >> following
> >>
> >> library(urca)
> >> example(ca.jo)

> >> trend <- matrix(1:nrow(sjf), ncol = 1)
> >> colnames(trend) <- "trd"
> >> ca.jo(sjf, type = "trace", ecdet = "const", K = 2, spec =
> "longrun",
> >> dumvar = trend)
> >>
> >> Best,
> >> Bernhard
> >>
> >>
> >>
> >>  ------------------------------
> >> *Von:* Grzegorz Konat [mailto:grzegorz.konat_at_ibrkk.pl]
> >> *Gesendet:* Donnerstag, 31. März 2011 14:40
> >>
> >> *An:* Pfaff, Bernhard Dr.; r-help_at_r-project.org
> >> *Betreff:* Re: [R] VECM with UNRESTRICTED TREND
> >>
> >> 'time' was a trend variable from my.data set. Equivalent to the
> >> output of the command 'matrix' you just gave me.
> >>
> >> So now I did:
> >>
> >>  library(urca)
> >> data(my.data)
> >> names(my.data)
> >> attach(my.data)
> >> dat1 <- my.data[, c("dY", "X", "dM")]
> >> mat1 <- matrix(seq(1:nrow(dat1)), ncol = 1)
> >> args('ca.jo')
> >> yxm.vecm <- ca.jo(dat1, type = "trace", ecdet = "const", K
> = 2, spec
> >> = "longrun", dumvar=mat1)
> >>
> >> and the output is:
> >>
> >>  Error in r[i1, , drop = FALSE] - r[-nrow(r):-(nrow(r) -
> lag + 1L), ,
> >> drop = FALSE] :
> >>   non-numeric argument to binary operator In addition: Warning
> >> message:
> >> In ca.jo(dat1, type = "trace", ecdet = "const", K = 2, spec =
> >> "longrun",
> >>  :
> >> No column names in 'dumvar', using prefix 'exo' instead.
> >>
> >> What do I do wrong?
> >>
> >> Best,
> >> Greg
> >>
> >>
> >> 2011/3/31 Pfaff, Bernhard Dr. <Bernhard_Pfaff_at_fra.invesco.com>
> >>
> >>>
> >>>
> >>>
> >>>  Hello Bernhard,
> >>>
> >>> thank You so much one again! Now I (more or less) understand the
> >>> idea, but still have problem with its practical application.
> >>>
> >>> I do (somewhat following example 8.1 in your textbook):
> >>>
> >>>  library(urca)
> >>> data(my.data)
> >>> names(my.data)
> >>> attach(my.data)
> >>> dat1 <- my.data[, c("dY", "X", "dM")]
> >>> dat2 <- cbind(time)
> >>>
> >>> What is 'time'? Just employ matrix(seq(1:nrow(dat1)),
> ncol = 1) for
> >>> creating the trend variable.
> >>>
> >>> Best,
> >>> Bernhard
> >>>
> >>>
> >>>  args('ca.jo')
> >>> yxm.vecm <- ca.jo(dat1, type = "trace", ecdet = "trend",
> K = 2, spec
> >>> = "longrun", dumvar=dat2)
> >>>
> >>> The above code produces following output:
> >>>
> >>>  Error in r[i1, , drop = FALSE] - r[-nrow(r):-(nrow(r) -
> lag + 1L),
> >>> , drop = FALSE] :
> >>>   non-numeric argument to binary operator
> >>>
> >>> What does that mean? Should I use cbind command to dat1
> as well? And
> >>> doesn't it transform the series into series of integer numbers?
> >>>
> >>> Thank you once again (especially for your patience).
> >>>
> >>> Best,
> >>> Greg
> >>>
> >>>
> >>>
> >>> 2011/3/31 Pfaff, Bernhard Dr. <Bernhard_Pfaff_at_fra.invesco.com>
> >>>
> >>>>  Hello Greg,
> >>>>
> >>>> you include your trend as a (Nx1) matrix and use this
> for 'dumvar'.
> >>>> The matrix 'dumvar' is just added to the VECM as deterministic
> >>>> regressors and while you are referring to case 5, this
> is basically
> >>>> what you are after, if I am not mistaken. But we aware that this
> >>>> implies a quadratic trend for the levels
>



Confidentiality Note: The information contained in this ...{{dropped:10}}

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 Fri 01 Apr 2011 - 08:27:18 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 Fri 01 Apr 2011 - 09:00:26 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