I am trying to fit a nonlinear LSTR fama regression of the form: x = (phi10 + phi1*zarfp) + (phi20 + phi2*zarfp)*{ [1 + exp(-gamma(zarfp - c))]^(-1) - 0.5} + u
x= exchange rate return of south african rand (ZARR)
zarfp=the forward premium of zar calculated as the forward 1-month rate minus the spot exchange rate
phi10 and phi20 are the constants
I also need to impose the following constraints: phi20 = - phi10 and phi2 = 1 - phi1
I used Terasvirta (1994) code and tried to modify it to use with this model. The modified code i used is the following:
Code: Select all
***start of code***
set x = zarr
stats x
compute scalef=1.0/sqrt(%variance)
*
nonlin(parmset=starparms) gamma c
frml flstar = %logistic(scalef*gamma*(zarfp-c),1.0)
compute c=%mean,gamma=2
equation standard x
#constant zarfp
equation transit x
#constant zarfp
*
frml(equation=standard,vector=phi1) phi1f
frml(equation=transit,vector=phi2) phi2f
frml star x = f=flstar,phi1f+f*phi2f
*
nonlin(parmset=regparms) phi1 phi2
nonlin(parmset=starparms) gamma c
nlls(parmet=regparms,frml=star) x
*
equation standard x
#constant zarfp
equation transit x
#constant zarfp
frml(equation=standard,vector=phi1) phi1f
frml(equation=transit,vector=phi2) phi2f
nlls(parmset=regparms,frml=star) x
nlls(parmset=regparms+starparms,frml=star) x
***end of code***
Code: Select all
***results start***
Nonlinear Least Squares - Estimation by Gauss-Newton
Convergence in 2 Iterations. Final criterion was 0.0000000 <= 0.0000100
Dependent Variable X
Monthly Data From 1983:10 To 2012:02
Usable Observations 247
Degrees of Freedom 243
Skipped/Missing (from 341) 94
Centered R^2 0.5534983
R-Bar^2 0.5479859
Uncentered R^2 0.5577250
Mean of Dependent Variable 0.0038656906
Std Error of Dependent Variable 0.0396237788
Standard Error of Estimate 0.0266398556
Sum of Squared Residuals 0.1724527029
Regression F(3,243) 100.4103
Significance Level of F 0.0000000
Log Likelihood 546.9992
Durbin-Watson Statistic 1.8625
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. PHI1(1) -0.030289521 0.013926828 -2.17490 0.03060211
2. PHI1(2) 0.800439097 0.314565158 2.54459 0.01156044
3. PHI2(1) 0.055678913 0.028139893 1.97865 0.04898499
4. PHI2(2) -0.249856505 0.220355790 -1.13388 0.25796324
Nonlinear Least Squares - Estimation by Gauss-Newton
Convergence in 2 Iterations. Final criterion was 0.0000000 <= 0.0000100
Dependent Variable X
Monthly Data From 1983:10 To 2012:02
Usable Observations 247
Degrees of Freedom 244
Skipped/Missing (from 341) 94
Centered R^2 0.5511359
R-Bar^2 0.5474567
Uncentered R^2 0.5553849
Mean of Dependent Variable 0.0038656906
Std Error of Dependent Variable 0.0396237788
Standard Error of Estimate 0.0266554462
Sum of Squared Residuals 0.1733651257
Regression F(2,244) 149.7972
Significance Level of F 0.0000000
Log Likelihood 546.3475
Durbin-Watson Statistic 1.8591
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. PHI1(1) -0.039251999 0.011473140 -3.42121 0.00073078
2. PHI1(2) 0.508067271 0.180282986 2.81817 0.00522583
3. PHI2(1) 0.072387915 0.023986914 3.01781 0.00281590
Nonlinear Least Squares - Estimation by Gauss-Newton
NO CONVERGENCE IN 100 ITERATIONS
LAST CRITERION WAS 0.0148635
Dependent Variable X
Monthly Data From 1983:10 To 2012:02
Usable Observations 247
Degrees of Freedom 242
Skipped/Missing (from 341) 94
Centered R^2 0.5586149
R-Bar^2 0.5513193
Uncentered R^2 0.5627931
Mean of Dependent Variable 0.0038656906
Std Error of Dependent Variable 0.0396237788
Standard Error of Estimate 0.0265414470
Sum of Squared Residuals 0.1704765151
Log Likelihood 548.4226
Durbin-Watson Statistic 1.8022
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. PHI1(1) -1.56961890 27.93518244 -0.05619 0.95523849
2. PHI1(2) -3.42856239 51.24802548 -0.06690 0.94671547
3. PHI2(1) 2.94346905 53.17023639 0.05536 0.95589787
4. GAMMA 0.27754188 1.97120718 0.14080 0.88814671
5. C -0.02039801 0.08519234 -0.23943 0.81097111
***end of results***
- Is the choice of my starting values for gamma and c that are giving this outcome? Should i try others and see when convergence is reached?
- in my FRML, i specify vectors for phi1 and phi2. I did this to follow the Terasvirta code but i actually dont have a vector of coefficients since i only have in both my standard and transit equations a contant and one regressor (the zarfp). So how should i specify this?
- In this code i am not including the constrains as i am not too sure how to do it. From what i understood from the users guide, i should add the following after the nonlin(parmset=regparms) phi1 phi2: nonlin(parmset=constraints) phi10=-phi10 phi2=1-phi1
The problem, and i realize this, is that i havent specified phi10, only a vector phi1...so this must be wrong!
I would be incredibly grateful if you could help with this...i desperately need it!!
Many thanks in advance!
Ana