Hi, I am running a UCM model (lldtrend), and have a question about interpreting the output. Essentially, after estimating the model I predict the trend and the residual. However, the variance of the residual is not the same at all as the variance in the output, so I am not sure what I am doing wrong. The code and results are here:
tsset order date
ucm logwages, model(lldtrend) iter(100)
predict trend, trend
predict resid, resid
egen sd_resid = sd(resid)
gen var_resid = sd_resid^2
I find that the sample var_resid is completely different from the "var(logwages)" in the UCM output. So, my question is what exactly is var(logwages) in the stata output? Thanks!
The output of this code from the UCM model is
. ucm logwages if order==4, model(lldtrend)
searching for initial values ..........
(setting technique to bhhh)
Iteration 0: log likelihood = -495.07646
Iteration 1: log likelihood = -494.57919
Iteration 2: log likelihood = -494.55704
Iteration 3: log likelihood = -494.55637
Iteration 4: log likelihood = -494.55535
(switching technique to nr)
Iteration 5: log likelihood = -494.55493
Iteration 6: log likelihood = -494.54656
Iteration 7: log likelihood = -494.54654
Refining estimates:
Iteration 0: log likelihood = -494.54654
Iteration 1: log likelihood = -494.54654
Unobserved-components model
Components: local level with deterministic trend
Sample: 61 - 229 Number of obs = 169
Log likelihood = -494.54654
-------------------------------------------------------------------------------
| OIM
logwages | Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
var(level)| 17.55737 3.758908 4.67 0.000 10.19005 24.92469
var(logwages)| 1.646977 1.751086 0.94 0.173 0 5.079043
-------------------------------------------------------------------------------
Note: Model is not stationary.
Note: Tests of variances against zero are one sided, and the two-sided
confidence intervals are truncated at zero.
tsset order date
ucm logwages, model(lldtrend) iter(100)
predict trend, trend
predict resid, resid
egen sd_resid = sd(resid)
gen var_resid = sd_resid^2
I find that the sample var_resid is completely different from the "var(logwages)" in the UCM output. So, my question is what exactly is var(logwages) in the stata output? Thanks!
The output of this code from the UCM model is
. ucm logwages if order==4, model(lldtrend)
searching for initial values ..........
(setting technique to bhhh)
Iteration 0: log likelihood = -495.07646
Iteration 1: log likelihood = -494.57919
Iteration 2: log likelihood = -494.55704
Iteration 3: log likelihood = -494.55637
Iteration 4: log likelihood = -494.55535
(switching technique to nr)
Iteration 5: log likelihood = -494.55493
Iteration 6: log likelihood = -494.54656
Iteration 7: log likelihood = -494.54654
Refining estimates:
Iteration 0: log likelihood = -494.54654
Iteration 1: log likelihood = -494.54654
Unobserved-components model
Components: local level with deterministic trend
Sample: 61 - 229 Number of obs = 169
Log likelihood = -494.54654
-------------------------------------------------------------------------------
| OIM
logwages | Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
var(level)| 17.55737 3.758908 4.67 0.000 10.19005 24.92469
var(logwages)| 1.646977 1.751086 0.94 0.173 0 5.079043
-------------------------------------------------------------------------------
Note: Model is not stationary.
Note: Tests of variances against zero are one sided, and the two-sided
confidence intervals are truncated at zero.