Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • UCM smooth trend


    Hello,

    I'm trying to estimate a simple unobserved component model with smooth trend on quarterly data of US PCE (core) inflation.
    If I estimate the model via "ucm", I type the following: ucm pce_exfe, model(strend)
    The model is expected to estimate a *smooth* trend (an I(2) series). However, I get what you see in the image below (which is essentially a random walk).

    I also tried to estimate the model via the "sspace" command. This is what I wrote:

    constraint 1 [trend]L.trend = 1
    constraint 2 [trend]L.slope = 1
    constraint 3 [slope]L.slope = 1
    constraint 4 [pce_exfe]trend= 1
    sspace (trend L.trend L.slope, state noerror noconstant) ///
    (slope L.slope, state noconstant) ///
    (pce_exfe trend, noconstant), ///
    constraints(1 2 3 4) covstate(diagonal) method(kdiffuse) difficult
    predict trend
    twoway (line pce_exfe time) (line trend time)

    However, I got similar results.

    The point is that the "smooth trend" model should be of the form:
    y(t) = mu(t) + epsilon(t)
    mu(t) = mu(t-1) + beta(t-1)
    beta(t) = beta(t-1) + eta(t)

    Such trend should be *smooth* by construction being an I(2) series. But no matter how you estimate it in STATA, you do not get something smooth (at least on these data).

    Am I doing anything wrong?

    Many thanks for your help!
    Best,
    R.

    Click image for larger version

Name:	Example.png
Views:	2
Size:	91.9 KB
ID:	1595255

  • #2
    Hi guys, any idea about the above? Thanks!

    Comment


    • #3
      I'm not familiar with unobserved components models, but Stata does have ucm. If you're looking for a smoothed series, you can just use tssmooth ma. Example below using quarterly core PCE

      Code:
      import delimited using "https://fred.stlouisfed.org/series/BPCCRO1Q156NBEA/downloaddata/BPCCRO1Q156NBEA.csv", clear 
      
      gen quarter = qofd(date(date, "YMD"))
      format quarter %tq
      
      tsset quarter, quarterly 
      
      ucm value, cycle(1)  model(strend) technique(bfgs)
      predict strend, trend
      
      tssmooth ma smoothed = value, window(4 1 4) 
      
      tsline smoothed strend value

      Comment


      • #4
        Hi Justin,
        Thanks for your reply.
        However, the problem here is that you have smoothed the series it self with a moving average.
        The ucm command (used with model(strend)) should produce a smooth trend similar to the centered moving average. But as well in your code, ucm results in a trend which is *not* smooth.

        Comment

        Working...
        X