Announcement

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

  • Unobserved Components Model

    I am using stata 12 and have to run the Unobserved Components Model for the first time my data is per hectare productivity time series from 1950-2014. my objective is to decompose the data into trend and cyclical components. I have gone through the concerned stata manuals but have three questions:

    1) How do I specify a quadratic model in stata (as I am using productivity time series data then I assume time and time square will be the two variables).

    2) the procedure I am using is the following: I run a few models and check the AIC and BIC. Then I choose the lowest one and run the model. Then I use estat, eperoid and predict options. But I am not certain what parameters I am supposed to look for.

    3) I am not able to run some models as I get the message not concave or backed up. I have gone through the stata manual it says that I have to use the iterate() option to limit the number of iterations, look to see which of the variances is being driven to 0, and drop that component from the model. I know how to change the iteration (my default is 1600) but cant understand the rest.
    thank you.

  • #2
    1) So, if you want to include a quadratic term for variable xyz, just include c.xyz##c.xyz in your model. You may want to consider centering variable xyz first.

    3) After you set the iterate option, Stata will carry out that number of iterations, and then it will stop and give you (interim) output. Those output are not results you can rely on, but they show you where Stata is going with the estimation. Look in the table of results to find variance components that are very close to zero. While you're at it, also look in the coefficients table to see if any of your variables have unreasonably large standard errors. With this information you can then simplify the model, eliminating the variance component(s) that were close to zero, and eliminating any fixed-effects with unreasonably large standard errors. The resulting, simplified model may well run without difficulties.

    Comment


    • #3
      Thank you for your reply.
      As my objective is to obtain the trend and cyclical components of the data to deduce whether scarcity is there I need to separate the trend and cyclical components.
      1. What are the parameters and hyperparameters I need to look for to derive the above conclusions? (My variances are not coming zero in all cases).
      2. How can I decompose the trend and cycles graphically in Stata? When I use the predict command I do not get smooth curves.

      Comment


      • #4
        I think you need to show us exactly what commands you gave and what Stata responded with. Best way to do this is to copy and paste from the Results window (or from your log file) into a code block on this forum. (If you don't know how to open a code block, see the FAQ).

        Comment


        • #5
          i have attached the results in a word file (due to inclusion of graphs i did not paste it).
          Attached Files
          Last edited by Jaweriah Abdullah; 29 Apr 2015, 03:22.

          Comment


          • #6
            It is generally not a good idea to post Word documents or Excel spreadsheet attachments here. Some of the more frequent responders on the forum do not use Microsoft Office products. And some of those who do will not open that kind of attachment from a stranger because they can contain active, and potentially malicious, content.

            Please post your results in a code block in the forum. If you don't know how that is done, see the FAQ.

            Comment


            • #7
              I have differenced the data. The curve seems to me to suggest presence of trend and cycle component and cycles.
              • gen dfg = fg-fg[_n-1]
              (Graph 1 shows this)


              I run 3 random walk models (model 1-without cycles, model 2-with 1 cycle and model 3- with 2 cycles) and check the AIC. The lowest AIC is for model 3 with 2 cycles.
              • ucm dfg, model(rwalk) cycle(1,frequency(2.5))cycle (2,frequency (1.5))
              Code:
              nobserved-components model
              Components: random walk, 2 cycles of order 1 2
              
              Sample: 1951 - 2013                               Number of obs   =         63
              Wald chi2(4)    =    2140.10
              Log likelihood = -349.03154                       Prob > chi2     =     0.0000
              
              OIM
              dfg       Coef.   Std. Err.      z    P>z     [95% Conf. Interval]
              
              cycle1      
              frequency    2.851024   .0681212    41.85   0.000     2.717509    2.984539
              damping      .80305   .0412079    19.49   0.000      .722284    .8838159
              
              cycle2      
              frequency     1.66175   .2447507     6.79   0.000     1.182048    2.141453
              damping    .5859185    .158746     3.69   0.000     .2747819     .897055
              
              Variance    
              level         5.344308   8.686863     0.62   0.269            0    22.37025
              cycle1        2515.814   956.2709     2.63   0.004     641.5575     4390.07
              cycle2        252.3216     335.42     0.75   0.226            0    909.7327
              
              Note: Model is not stationary.
              Note: Tests of variances against zero are one sided, and the two-sided confidence    intervals    are    truncated
              at zero.
              I convert the cycles into periods
              • estat period
              Code:
                              
              cycle1    Coef.    Std. Err.    [95% Conf.    Interval]
                              
              period    2.203835    .0526575    2.100628    2.307042
              frequency    2.851024    .0681212    2.717509    2.984539
              damping    .80305    .0412079    .722284    .8838159
                              
              
                              
              cycle2    Coef.    Std. Err.    [95% Conf.    Interval]
                              
              period    3.781065    .5568936    2.689573    4.872556
              frequency    1.66175    .2447507    1.182048    2.141453
              damping    .5859185    .158746    .2747819    .897055

              Then I generate the Spectral density to see if a two cycle model is correct
              • psdensity sdensity2a omega2a
              • psdensity sdensity2b omega2b, cycle(2)
              • line sdensity2a sdensity2b omega2a, legend(col(1))
              The graph (graph 2) seems to suggest that the model is correct.

              Then I want to decompose the trend and the 2 cycles so I use the command
              • predict strend, trend
              • predict cycle1 cycle2, cycle
              • tsline dfg strend, name(trend) nodraw legend(rows(1))
              • tsline cycle1, name(cycle1) yline(0,lwidth(vthin)) nodraw
              • tsline cycle2, name(cycle2) yline(0,lwidth(vthin)) nodraw
              • graph combine trend cycle1 cycle2, rows(3)
              Graph 3 shows the results

              Comment

              Working...
              X