It induces a unit root in the MA part which is not invertible, and breaks most assumptions underlying the handling of ARMA errors. The best remedy for overdifferencing is to not overdifference in the first place.ac_1 wrote: ↑Mon Dec 02, 2024 1:13 pmThanks.TomDoan wrote: ↑Sun Dec 01, 2024 7:35 am If you first difference an equation that doesn't not need it, you induce a moving average term of the form (1-L)eps which will show high negative autocorrelation. (Just take the equation and difference it to see). It won't be as big a problem if the process had a AR root relatively near 1; it should show some negative residual autocorrelation, but it might not be large enough to show in contrast to the usual residual autocorrelation.
1st-differencing y1: linear trend (i.e. a stationary process around a deterministic trend or trend-stationary process) produces a high negative autocorrelation in the residuals at lag 1. Can that not be handled w.r.t. fit and forecasts? TSay(2010) p.588 models linear regression with ARMA errors.
simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
TomDoan wrote: ↑Fri Nov 29, 2024 10:39 amI think it would help you to figure that out yourself. Solve the recursion that you used to create the data.ac_1 wrote: ↑Fri Nov 29, 2024 1:59 am I have included a TRENDSQ term to the 4th, y4: quadratic trend process and removed the constant.
The AR{1} term is near 1.0, however TREND is "a" and TRENDSQ is "b", why is that?Code: Select all
Variable Coeff Std Error T-Stat Signif ************************************************************************************ 1. AR{1} 0.982196673 0.008053562 121.95805 0.00000000 2. TREND 10.036218055 0.018950239 529.60905 0.00000000 3. TRENDSQ 0.025009592 0.000032593 767.33484 0.00000000
Actually, re-instating and re-estimating y4. I have retrieved the parameters.
Code: Select all
Dependent Variable Y4
Variable Coeff
***********************************
1. Constant 10.034877321
2. Y4{1} 1.000000000
3. TREND 0.049989299Thus, y1 to y3 are estimated in levels as I have recently specified, and y4 estimated with BOXJENK(REGRESSORS) and diffs = 1.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
These are constructed series, aim being how best to model them, and also to retrieve the parameters.TomDoan wrote: ↑Mon Dec 02, 2024 2:10 pm My suggestion is that you go back to Nelson and Plosser and read the mathematical background. They go over the difference between trend stationary and difference stationary series (basically what you are simulating here) and how the wrong choice can cause problems (what you are discovering here).
Note that @BJDIFF is not designed to allow for a trend stationary series.
I have re-familiarised myself with Nelson and Plosser. Why would I model the 4 constructed series in logs? But if I was to, would I have to log the trend term as-well? Also, there may be strong autocorrelation in the residuals. Furthermore, @BJTRANS the criterion (the higher value is better) suggests NONE, all series.
Regarding @BJDIFF, in addition I use the unit roots tests with CONSTANT, and TREND.
Again, let me know if the estimated fits and forecasts are wrong.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
To reiterate: Nelson and Plosser's result was that the typical trending economic series was best described as a difference stationary series when in logs. If you are trying to generate something like that, you would do the simulation and then exp up to get a simulated trending economic series. If you are just interested in the representation of the linear trend itself, you wouldn't need that extra step. If, on the other hand, you are trying to figure out how to handle actual data, you would exp your simulated data and see whether it properly is classified as needing log transformation.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Thanks Tom.
I can follow the AR(2) example here: https://estima.com/webhelp/topics/simul ... ction.html
And also do something like
But how do I know the model produces a Difference Stationary series?
In otherwords, how do I simulate an I(d), d>=1 series, original (mean), and in logs (mean or median) then exp up to get a simulated trending economic series in RATS?
I have seen elsewhere simulating Trend Stationary (mean trend is deterministic) and Difference Stationary (mean trend is stochastic) stationary processes, from sample paths as a plot - the advantage being an idea regarding constant/non-constant variance.
Peter C Philips has the Nelson and Plosser data set http://korora.econ.yale.edu/phillips/. I'd like to replicate their results.
However, there is a problem with y3: stochastic trend
Instead
If phi1 = +0.1, the magnitude of the AR(1) Coeff does not change.
If phi1 = -0.8, the sign of the AR(1) Coeff does not change. Similarly if I increase phi1 to e.g. -0.3.
Why?
Yes, I am interested in both.TomDoan wrote: ↑Wed Dec 04, 2024 7:25 am To reiterate: Nelson and Plosser's result was that the typical trending economic series was best described as a difference stationary series when in logs.
If you are trying to generate something like that, you would do the simulation and then exp up to get a simulated trending economic series.
If you are just interested in the representation of the linear trend itself, you wouldn't need that extra step.
I can follow the AR(2) example here: https://estima.com/webhelp/topics/simul ... ction.html
And also do something like
Code: Select all
* ARMA(1,1): y(t) = 2.0 + 0.8*y(t-1) + e(t) - 0.9*e(t-1)
set e 1 nburn+nobs = %ran(sigma)
compute c1 = +2.0
compute phi1 = +0.8
compute theta1 = +0.9
set(first=0.0) y 1 nburn+nobs = c1 + phi1*y{1} + e - theta1*e{1}In otherwords, how do I simulate an I(d), d>=1 series, original (mean), and in logs (mean or median) then exp up to get a simulated trending economic series in RATS?
I have seen elsewhere simulating Trend Stationary (mean trend is deterministic) and Difference Stationary (mean trend is stochastic) stationary processes, from sample paths as a plot - the advantage being an idea regarding constant/non-constant variance.
Peter C Philips has the Nelson and Plosser data set http://korora.econ.yale.edu/phillips/. I'd like to replicate their results.
Yes, I have exp'd y1, y2 and y3, and @BJTRANS works well, the higher the better - all 3 being classified as log t/f's. I cannot exp y4 the quadratic trend, I get huge numbers.
However, there is a problem with y3: stochastic trend
Code: Select all
comp a = 10.0; * constant
comp b = 0.05; * trend
comp phi1 = +0.8; * |phi1|<1
set(first=0.0) stochtrend 1 nburn+nobs = b+1.0*stochtrend{1}+u
set(first=0.0) z 1 nburn+nobs = phi1*z{1}+u
set(first=0.0) y3 1 nburn+nobs = stochtrend + z
linreg(define=eq3lreg) y3 nburn+1 nburn+nobs resids_eq3lreg
# constant y3{1} trend
disp eq3lreg
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.7276644490 0.3331950424 2.18390 0.02943640
2. Y3{1} 0.9421979581 0.0149556923 62.99929 0.00000000
3. TREND 0.0036719563 0.0011482076 3.19799 0.00147213
boxjenk(print,ar=||1||,diffs=0,ma=0,REGRESSORS,define=eq3bjreg,MAXL) y3 nburn+1 nburn+nobs resids_eq3bjreg
# constant trend
disp eq3bjreg
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. AR{1} 0.9426198998 0.0147187934 64.04193 0.00000000
2. Constant 9.1138779282 4.6456132996 1.96182 0.05034063
3. TREND 0.0680146981 0.0097594203 6.96913 0.00000000If phi1 = +0.1, the magnitude of the AR(1) Coeff does not change.
If phi1 = -0.8, the sign of the AR(1) Coeff does not change. Similarly if I increase phi1 to e.g. -0.3.
Why?
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
In enders4p186.rpf, to estimate Figure 4.2: Four Series With Trends I would
(a) rw: boxjenk(ar=0,diffs=1,ma=0)
(b) dr: boxjenk(constant,ar=0,diffs=1,ma=0)
(c) ts:
linreg ts
# constant trend
OR
boxjenk(ar=0,diffs=0,ma=0,GLS) ts
# constant trend
Correct?
How do I estimate (d) rwn ?
(a) rw: boxjenk(ar=0,diffs=1,ma=0)
(b) dr: boxjenk(constant,ar=0,diffs=1,ma=0)
(c) ts:
linreg ts
# constant trend
OR
boxjenk(ar=0,diffs=0,ma=0,GLS) ts
# constant trend
Correct?
How do I estimate (d) rwn ?
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
I told you how to simulate the trending series back right at the beginning of the thread:
viewtopic.php?p=19506#p19506
Add stationary noise to the first, and you get a trend stationary series; add stationary noise to the second and you get a difference stationary series.
BOXJENK(DIFFS=1,MA=1,NOCONST) rwn
viewtopic.php?p=19506#p19506
Add stationary noise to the first, and you get a trend stationary series; add stationary noise to the second and you get a difference stationary series.
That creates an ARIMA(0,1,1) process where the MA coefficient depends upon the variances of the two noises. (Difference the generated series and you get eps(t)+eta(t)-eta(t-1) where eta is the added noise).
BOXJENK(DIFFS=1,MA=1,NOCONST) rwn
That, of course, is the reason that the quadratic trend isn't considered to be a reasonable model---eventually the quadratic term will dominate. However, you should be able to reduce (obviously rather substantially) the coefficient on the quadratic term to get something that is reasonable.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Because you are estimating a completely incorrect model. y3 is going to be have ARIMA(1,1,1) model with just a constant not an AR(1) with constant and trend.ac_1 wrote: ↑Thu Dec 05, 2024 1:53 am However, there is a problem with y3: stochastic trend
InsteadCode: Select all
comp a = 10.0; * constant comp b = 0.05; * trend comp phi1 = +0.8; * |phi1|<1 set(first=0.0) stochtrend 1 nburn+nobs = b+1.0*stochtrend{1}+u set(first=0.0) z 1 nburn+nobs = phi1*z{1}+u set(first=0.0) y3 1 nburn+nobs = stochtrend + z linreg(define=eq3lreg) y3 nburn+1 nburn+nobs resids_eq3lreg # constant y3{1} trend disp eq3lreg Variable Coeff Std Error T-Stat Signif ************************************************************************************ 1. Constant 0.7276644490 0.3331950424 2.18390 0.02943640 2. Y3{1} 0.9421979581 0.0149556923 62.99929 0.00000000 3. TREND 0.0036719563 0.0011482076 3.19799 0.00147213 boxjenk(print,ar=||1||,diffs=0,ma=0,REGRESSORS,define=eq3bjreg,MAXL) y3 nburn+1 nburn+nobs resids_eq3bjreg # constant trend disp eq3bjreg Variable Coeff Std Error T-Stat Signif ************************************************************************************ 1. AR{1} 0.9426198998 0.0147187934 64.04193 0.00000000 2. Constant 9.1138779282 4.6456132996 1.96182 0.05034063 3. TREND 0.0680146981 0.0097594203 6.96913 0.00000000
If phi1 = +0.1, the magnitude of the AR(1) Coeff does not change.
If phi1 = -0.8, the sign of the AR(1) Coeff does not change. Similarly if I increase phi1 to e.g. -0.3.
Why?
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
There's a copy of nelsonplosser.rat in the RATS examples directory. (And in a couple of the example programs as well).ac_1 wrote: ↑Thu Dec 05, 2024 1:53 am Peter C Philips has the Nelson and Plosser data set http://korora.econ.yale.edu/phillips/. I'd like to replicate their results.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Sorry typo, the ts estimations should not have a constant.ac_1 wrote: ↑Thu Dec 05, 2024 1:58 am In enders4p186.rpf, to estimate Figure 4.2: Four Series With Trends I would
(a) rw: boxjenk(ar=0,diffs=1,ma=0)
(b) dr: boxjenk(constant,ar=0,diffs=1,ma=0)
(c) ts:
linreg ts
# constant trend
OR
boxjenk(ar=0,diffs=0,ma=0,GLS) ts
# constant trend
Correct?
How do I estimate (d) rwn ?
Thanks.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
Above, I managed to recover the parameters simulating the series asac_1 wrote: ↑Wed Dec 04, 2024 3:16 amTomDoan wrote: ↑Fri Nov 29, 2024 10:39 amI think it would help you to figure that out yourself. Solve the recursion that you used to create the data.ac_1 wrote: ↑Fri Nov 29, 2024 1:59 am I have included a TRENDSQ term to the 4th, y4: quadratic trend process and removed the constant.
The AR{1} term is near 1.0, however TREND is "a" and TRENDSQ is "b", why is that?Code: Select all
Variable Coeff Std Error T-Stat Signif ************************************************************************************ 1. AR{1} 0.982196673 0.008053562 121.95805 0.00000000 2. TREND 10.036218055 0.018950239 529.60905 0.00000000 3. TRENDSQ 0.025009592 0.000032593 767.33484 0.00000000
Actually, re-instating and re-estimating y4. I have retrieved the parameters.
Code: Select all
Dependent Variable Y4 Variable Coeff *********************************** 1. Constant 10.034877321 2. Y4{1} 1.000000000 3. TREND 0.049989299
set(first=0.0) y4 1 nburn+nobs = a + 1.0*y4{1} + b*trend + u
Could I also simulate y4: RWD plus Linear Trend as
set(first=0.0) y1 1 nburn+nobs = a + b*trend + u
set(first=1.0) rw 1 nburn+nobs = 1.0*rw{1} + u
set(first=0.0) y4 1 nburn+nobs = y1 + rw
If so, how to estimate?
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
For Nelson and Plosser simulation I have
Which is just y3 in logs and then exp to get the forecasts. Correct?
Code: Select all
all 700
seed 123
compute nsteps=200
compute nburn=200
compute nobs=500
set u 1 nburn+nobs = %ran(1.0)
set trend 1 nburn+nobs+nsteps = t
comp a = 10.0; * constant
comp b = 0.05; * trend
comp phi1 = +0.8; * |phi1|<1
set(first=0.0) stochtrend 1 nburn+nobs = b+1.0*stochtrend{1}+u
set(first=0.0) z 1 nburn+nobs = phi1*z{1}+u
set(first=0.0) y3 1 nburn+nobs = stochtrend + z
set(first=0.0) ly3 1 nburn+nobs = log(y3)
boxjenk(print,constant,ar=||1||,diffs=1,ma=||1||,define=eq3_bjd,MAXL) ly3 nburn+1 nburn+nobs resids_eq3_bjd
disp eq3_bjd
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
No. 100% no. First, you're using the same shocks for the two components. You don't want to do that---those should be independent processes.ac_1 wrote: ↑Sat Dec 07, 2024 12:39 pm For Nelson and Plosser simulation I have
Which is just y3 in logs and then exp to get the forecasts. Correct?Code: Select all
all 700 seed 123 compute nsteps=200 compute nburn=200 compute nobs=500 set u 1 nburn+nobs = %ran(1.0) set trend 1 nburn+nobs+nsteps = t comp a = 10.0; * constant comp b = 0.05; * trend comp phi1 = +0.8; * |phi1|<1 set(first=0.0) stochtrend 1 nburn+nobs = b+1.0*stochtrend{1}+u set(first=0.0) z 1 nburn+nobs = phi1*z{1}+u set(first=0.0) y3 1 nburn+nobs = stochtrend + z set(first=0.0) ly3 1 nburn+nobs = log(y3) boxjenk(print,constant,ar=||1||,diffs=1,ma=||1||,define=eq3_bjd,MAXL) ly3 nburn+1 nburn+nobs resids_eq3_bjd disp eq3_bjd
Second, the difference stationary series is supposed to represent the log of an economic series. You don't take the log of it; you take the exp of it to get something with the behavior of an economic time series.
Re: simulate, estimate and forecast OOS univariate models incorporating a linear trend term
1. Doesn't RWD mean Random Walk with DRIFT? Where's the drift?
2. You are using the same shock in the two component processes. Don't do that.
3. A trend stationary process + a difference stationary process is a difference stationary process. You can verify that by taking the first difference of the sum of the two and seeing what happens. If you again read carefully through Nelson and Plosser, you will see that taking first differences and seeing what happens is how they look at the processes.