Sticky Prices - Jadresic (1999)
-
chaveslima
- Posts: 18
- Joined: Mon Jun 25, 2012 3:49 pm
Sticky Prices - Jadresic (1999)
Does anyone have Jadresic RATS' code used in the 1999 article "Sticky Prices: an empirical assessment of alternative models?"
Last edited by chaveslima on Tue Jun 02, 2015 7:06 am, edited 1 time in total.
Re: Sticky Prices - Jadresic (1999)
Nowadays, you would do that by using parameter set restrictions rather than the method described in the paper.
Code: Select all
*
* Generate moving averages of money growth
*
compute n=8
dec vect[series] fmhat(n)
do i=1,n
filter(type=lagging,span=i) mhat / fmhat(i)
end do i
*
dec vect lambda(n)
nonlin(parmset=base) lambda
nonlin(parmset=nonneg) lambda>=0.0
nonlin(parmset=sum) %sum(lambda)==1.0
nonlin(parmset=peg3) lambda(3)==0.0
*
function lagsum t
type integer t
compute lagsum=0.0
do i=1,n
compute lagsum=lagsum+lambda(i)*fmhat(i)(t-1)
end do i
end
*
frml dlfrml = lagsum(t)
*
* These are A through D in order
*
nlls(parmset=base,frml=dlfrml) phat
nlls(parmset=base+sum,frml=dlfrml) phat
nlls(parmset=base+sum+nonneg,frml=dlfrml) phat
nlls(parmset=base+sum+nonneg+peg3,frml=dlfrml) phat
-
chaveslima
- Posts: 18
- Joined: Mon Jun 25, 2012 3:49 pm
Re: Sticky Prices - Jadresic (1999)
Dear Tom
First of all, thanks to responding my question on Jadresic's paper. I am trying to run the codes you've sent me, but i am having trouble
on the following:
compute n=8
dec vect[series] fmhat(n)
do i=1,n
filter(type=lagging,span=i) mhat / fmhat(i)
end do i
*
After passing the "filter(type=lagging,span=i) mhat / fmhat(i)" line, we get the following message:
## I2. Expected Instruction Here
>>>>
And it does not go through. Could you kindly help us on this?
all the best
Ricardo
First of all, thanks to responding my question on Jadresic's paper. I am trying to run the codes you've sent me, but i am having trouble
on the following:
compute n=8
dec vect[series] fmhat(n)
do i=1,n
filter(type=lagging,span=i) mhat / fmhat(i)
end do i
*
After passing the "filter(type=lagging,span=i) mhat / fmhat(i)" line, we get the following message:
## I2. Expected Instruction Here
>>>>
And it does not go through. Could you kindly help us on this?
all the best
Ricardo
Re: Sticky Prices - Jadresic (1999)
So far as I can tell, it's fine if you copy out of the forum and straight into RATS. If you are having a problem, you may need to just re-type the line.
-
chaveslima
- Posts: 18
- Joined: Mon Jun 25, 2012 3:49 pm
Re: Sticky Prices - Jadresic (1999)
Thanks Tom. It did work!
-
chaveslima
- Posts: 18
- Joined: Mon Jun 25, 2012 3:49 pm
Re: Sticky Prices - Jadresic (1999)
Tom as I said it is working, but I am having a strange message (error message?) before
getting the results, as follows. Is it a problem?
## NL6. NONLIN Parameter LAMBDA(1) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(2) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(3) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(4) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(5) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(6) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(7) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(8) Has Not Been Initialized. Trying 0
Nonlinear Least Squares - Estimation by Gauss-Newton
Convergence in 2 Iterations. Final criterion was 0.0000000 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 0.4197009
R-Bar^2 0.3508519
Uncentered R^2 0.7056196
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0162816536
Sum of Squared Residuals 0.0156404423
Log Likelihood 185.0778
Durbin-Watson Statistic 1.0770
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.372143234 0.220106022 1.69075 0.09616240
2. LAMBDA(2) 0.286934121 0.470284426 0.61013 0.54411939
3. LAMBDA(3) -0.370850305 0.676015180 -0.54858 0.58536179
4. LAMBDA(4) 0.171287326 0.724727675 0.23635 0.81398191
5. LAMBDA(5) 0.296869605 0.690873468 0.42970 0.66897784
6. LAMBDA(6) -0.059442732 0.843996839 -0.07043 0.94408957
7. LAMBDA(7) -1.794652541 0.907915129 -1.97667 0.05275847
8. LAMBDA(8) 1.717871827 0.524116875 3.27765 0.00175714
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 6 Iterations. Final criterion was 0.0000053 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.0078403
R-Bar^2 -0.1274146
Uncentered R^2 0.4887319
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0214569720
Sum of Squared Residuals 0.0271636971
Log Likelihood 166.5851
Durbin-Watson Statistic 0.7173
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.560329619 0.287620018 1.94816 0.05615779
2. LAMBDA(2) 0.161065130 0.619259060 0.26009 0.79569735
3. LAMBDA(3) -0.565543766 0.890044305 -0.63541 0.52761739
4. LAMBDA(4) 0.693543849 0.949368909 0.73053 0.46795647
5. LAMBDA(5) 0.285684399 0.910472914 0.31378 0.75479802
6. LAMBDA(6) -0.195766632 1.111937223 -0.17606 0.86085045
7. LAMBDA(7) -1.846197139 1.196462431 -1.54305 0.12816657
8. LAMBDA(8) 1.906883569 0.689679655 2.76488 0.00758767
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 9 Iterations. Final criterion was 0.0000055 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.1319616
R-Bar^2 -0.2662621
Uncentered R^2 0.4257663
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0227398925
Sum of Squared Residuals 0.0305090599
Log Likelihood 162.6943
Durbin-Watson Statistic 0.7757
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.3937 0.2377 1.65599 0.10303419
2. LAMBDA(2) 0.2681 0.2824 0.94963 0.34617172
3. LAMBDA(3) 3.9364e-08 0.0000 0.00000 0.00000000
4. LAMBDA(4) 3.9821e-09 0.0000 0.00000 0.00000000
5. LAMBDA(5) -9.8642e-08 0.0000 0.00000 0.00000000
6. LAMBDA(6) -2.1680e-07 5.0859e-08 -4.26284 0.00007381
7. LAMBDA(7) -2.0365e-07 0.0000 0.00000 0.00000000
8. LAMBDA(8) 0.3382 0.1309 2.58345 0.01227918
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 6 Iterations. Final criterion was 0.0000015 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.1319582
R-Bar^2 -0.2662583
Uncentered R^2 0.4257680
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0227398585
Sum of Squared Residuals 0.0305089686
Log Likelihood 162.6944
Durbin-Watson Statistic 0.7763
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.3962 0.2512 1.57713 0.12011226
2. LAMBDA(2) 0.2619 0.3484 0.75151 0.45533464
3. LAMBDA(3) 1.0662e-08 2.1686e-08 0.49163 0.62480340
4. LAMBDA(4) 6.8394e-03 0.2218 0.03083 0.97550773
5. LAMBDA(5) -2.9582e-08 3.2530e-08 -0.90938 0.36684883
6. LAMBDA(6) -6.3409e-08 5.9391e-08 -1.06766 0.29002280
7. LAMBDA(7) -5.9103e-08 5.0859e-08 -1.16210 0.24987607
8. LAMBDA(8) 0.3351 0.1640 2.04301 0.04552621
getting the results, as follows. Is it a problem?
## NL6. NONLIN Parameter LAMBDA(1) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(2) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(3) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(4) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(5) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(6) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(7) Has Not Been Initialized. Trying 0
## NL6. NONLIN Parameter LAMBDA(8) Has Not Been Initialized. Trying 0
Nonlinear Least Squares - Estimation by Gauss-Newton
Convergence in 2 Iterations. Final criterion was 0.0000000 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 0.4197009
R-Bar^2 0.3508519
Uncentered R^2 0.7056196
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0162816536
Sum of Squared Residuals 0.0156404423
Log Likelihood 185.0778
Durbin-Watson Statistic 1.0770
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.372143234 0.220106022 1.69075 0.09616240
2. LAMBDA(2) 0.286934121 0.470284426 0.61013 0.54411939
3. LAMBDA(3) -0.370850305 0.676015180 -0.54858 0.58536179
4. LAMBDA(4) 0.171287326 0.724727675 0.23635 0.81398191
5. LAMBDA(5) 0.296869605 0.690873468 0.42970 0.66897784
6. LAMBDA(6) -0.059442732 0.843996839 -0.07043 0.94408957
7. LAMBDA(7) -1.794652541 0.907915129 -1.97667 0.05275847
8. LAMBDA(8) 1.717871827 0.524116875 3.27765 0.00175714
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 6 Iterations. Final criterion was 0.0000053 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.0078403
R-Bar^2 -0.1274146
Uncentered R^2 0.4887319
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0214569720
Sum of Squared Residuals 0.0271636971
Log Likelihood 166.5851
Durbin-Watson Statistic 0.7173
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.560329619 0.287620018 1.94816 0.05615779
2. LAMBDA(2) 0.161065130 0.619259060 0.26009 0.79569735
3. LAMBDA(3) -0.565543766 0.890044305 -0.63541 0.52761739
4. LAMBDA(4) 0.693543849 0.949368909 0.73053 0.46795647
5. LAMBDA(5) 0.285684399 0.910472914 0.31378 0.75479802
6. LAMBDA(6) -0.195766632 1.111937223 -0.17606 0.86085045
7. LAMBDA(7) -1.846197139 1.196462431 -1.54305 0.12816657
8. LAMBDA(8) 1.906883569 0.689679655 2.76488 0.00758767
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 9 Iterations. Final criterion was 0.0000055 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.1319616
R-Bar^2 -0.2662621
Uncentered R^2 0.4257663
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0227398925
Sum of Squared Residuals 0.0305090599
Log Likelihood 162.6943
Durbin-Watson Statistic 0.7757
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.3937 0.2377 1.65599 0.10303419
2. LAMBDA(2) 0.2681 0.2824 0.94963 0.34617172
3. LAMBDA(3) 3.9364e-08 0.0000 0.00000 0.00000000
4. LAMBDA(4) 3.9821e-09 0.0000 0.00000 0.00000000
5. LAMBDA(5) -9.8642e-08 0.0000 0.00000 0.00000000
6. LAMBDA(6) -2.1680e-07 5.0859e-08 -4.26284 0.00007381
7. LAMBDA(7) -2.0365e-07 0.0000 0.00000 0.00000000
8. LAMBDA(8) 0.3382 0.1309 2.58345 0.01227918
Nonlinear Least Squares - Estimation by BFGS Restricted
Convergence in 6 Iterations. Final criterion was 0.0000015 <= 0.0000100
Dependent Variable PHAT
Quarterly Data From 1996:02 To 2014:04
Usable Observations 67
Degrees of Freedom 59
Skipped/Missing (from 75) 8
Centered R^2 -0.1319582
R-Bar^2 -0.2662583
Uncentered R^2 0.4257680
Mean of Dependent Variable 0.0197664202
Std Error of Dependent Variable 0.0202081522
Standard Error of Estimate 0.0227398585
Sum of Squared Residuals 0.0305089686
Log Likelihood 162.6944
Durbin-Watson Statistic 0.7763
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LAMBDA(1) 0.3962 0.2512 1.57713 0.12011226
2. LAMBDA(2) 0.2619 0.3484 0.75151 0.45533464
3. LAMBDA(3) 1.0662e-08 2.1686e-08 0.49163 0.62480340
4. LAMBDA(4) 6.8394e-03 0.2218 0.03083 0.97550773
5. LAMBDA(5) -2.9582e-08 3.2530e-08 -0.90938 0.36684883
6. LAMBDA(6) -6.3409e-08 5.9391e-08 -1.06766 0.29002280
7. LAMBDA(7) -5.9103e-08 5.0859e-08 -1.16210 0.24987607
8. LAMBDA(8) 0.3351 0.1640 2.04301 0.04552621
Re: Sticky Prices - Jadresic (1999)
No. You didn't give guess values to the parameters. The default 0 seems to work fine since all the models converge OK.