simulation of paritial price adjustment
simulation of paritial price adjustment
I want to simulate partial price adjustment-Amihud and Mendelson in JOF.
This model is as follows.
R(t)=P(t)-P(t-1)=g(V(t)-P(t-1))+U(t)
V(t)-V(t-1)=mu+e(t)
0<g<2
V(t) and P(t) in Logarithm and unobserved true price and observed price respectly.
g is partial adjuste coefficient
mu is mean of intrinsic value random walk process
U(t) is white noise
e(t) is innovation of logarithmic intrinsic value which must be uncorrelated if the market is efficient
How can i simulate this model?
thank you in advance....
This model is as follows.
R(t)=P(t)-P(t-1)=g(V(t)-P(t-1))+U(t)
V(t)-V(t-1)=mu+e(t)
0<g<2
V(t) and P(t) in Logarithm and unobserved true price and observed price respectly.
g is partial adjuste coefficient
mu is mean of intrinsic value random walk process
U(t) is white noise
e(t) is innovation of logarithmic intrinsic value which must be uncorrelated if the market is efficient
How can i simulate this model?
thank you in advance....
Re: simulation of paritial price adjustment
This shows three options.
Code: Select all
dec series p v
dec real mu g sigu sige
*
* Parameter settings
*
compute mu=.02,g=.5,sigu=.1,sige=.2
compute sw=%diag(||sigu^2,sige^2||)
*
* Method 1. If u and e are uncorrelated with each other, v is exogenous,
* so these can be drawn successively. This uses pre-sample values of 0
* for both.
*
set(first=0.0) v = v{1}+mu+%ran(sige)
set(first=0.0) p = p{1}+g*(v-p{1})+%ran(sigu)
*
* Method 2. Use SIMULATE. Again. This can accept any covariance matrix,
* which is input using the FACTOR option on SIMULATE. The P and V series
* are set because of the >>p and >>v on the GROUP instruction. This uses
* pre-sample values of 0 for both series.
*
frml h1 p = p{1}+g*(v-p{1})
frml h2 v = mu+v{1}
group padj2 h1>>p h2>>v
set p 1 100 = 0.0
set v 1 100 = 0.0
simulate(model=padj2,from=2,to=100,factor=%decomp(sw))
*
* Method 3. Use DSGE to create a state space model. This can accept any
* covariance matrix of u and e. This draws the data conditional only on
* one arbitrary value---the model has the two series cointegrated. With
* the other two methods, you need to discard a segment as "burn-in".
*
frml f1 = p-p{1}-g*(v-p{1})
frml f2 = v-v{1}-mu
*
group padj f1 f2
*
dsge(model=padj,a=adlm,f=fdlm,z=zdlm) p v
dlm(type=simulate,a=adlm,f=fdlm,z=zdlm,sw=sw,presample=ergodic) 1 10000 xstates
*
* Pull out the p and v from the state vectors
*
set p 1 100 = xstates(t)(1)
set v 1 100 = xstates(t)(2)Re: simulation of paritial price adjustment
Thank you Tom.
I simulate all three methods. The Theobold and Yallup(2004-journal of financial market),
they argue that this simulation model is estimated by ARMA(1,1) and partial adjustment
coefficient(g) interprete as 1-ar(1)coefficient. Table 1 is a results of Damodran(1993),
autocovariance ratio, and ARMA(1,1).
Here is Theobold and Yallup paper site.
http://www.sciencedirect.com/science/ar ... 7d1f0c3899
After doing simulation, I have a strange result. I think the third method is right.
Let me know what modify the other two codes getting the third method result.
Tom, If you can, please write simulation code to get result of table 1(simulation result) in Theobold and Yallup's paper.
The program is as follows.
all 10000
dec series p v
dec real mu g sigu sige
*
* Parameter settings
*
compute mu=.02,g=.5,sigu=.1,sige=.2
compute sw=%diag(||sigu^2,sige^2||)
*
* Method 1. If u and e are uncorrelated with each other, v is exogenous,
* so these can be drawn successively. This uses pre-sample values of 0
* for both.
*
set(first=0.0) v = v{1}+mu+%ran(sige)
set(first=0.0) p = p{1}+g*(v-p{1})+%ran(sigu)
BOXJENK(CONST,MAXL,AR=1,MA=1) P
*
* Method 2. Use SIMULATE. Again. This can accept any covariance matrix,
* which is input using the FACTOR option on SIMULATE. The P and V series
* are set because of the >>p and >>v on the GROUP instruction. This uses
* pre-sample values of 0 for both series.
*
frml h1 p = p{1}+g*(v-p{1})
frml h2 v = mu+v{1}
group padj2 h1>>p h2>>v
set p 1 10000 = 0.0
set v 1 10000 = 0.0
simulate(model=padj2,from=2,to=100,factor=%decomp(sw))
BOXJENK(CONST,MAXL,AR=1,MA=1) P
*
* Method 3. Use DSGE to create a state space model. This can accept any
* covariance matrix of u and e. This draws the data conditional only on
* one arbitrary value---the model has the two series cointegrated. With
* the other two methods, you need to discard a segment as "burn-in".
*
frml f1 = p-p{1}-g*(v-p{1})
frml f2 = v-v{1}
*
group padj f1 f2
*
dsge(model=padj,a=adlm,f=fdlm) p v
dlm(type=simulate,a=adlm,f=fdlm,sw=sw,presample=ergodic) 1 10000 xstates
*
* Pull out the p and v from the state vectors
*
set p 1 10000 = xstates(t)(1)
set v 1 10000 = xstates(t)(2)
BOXJENK(CONST,MAXL,AR=1,MA=1) P
Ths results is as follows.
method 1:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 19.56331429 161.00775380 0.12151 0.90329317
2. AR{1} 0.99999831 0.00001922 52019.08616 0.00000000
3. MA{1} 0.10517620 0.00996566 10.55386 0.00000000
1-ar(1) (g)
method 2:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 0.005381187 0.008599618 0.62575 0.53149509
2. AR{1} 0.968297100 0.002581308 375.11880 0.00000000
3. MA{1} -0.030926963 0.010343852 -2.98989 0.00279759
1-ar(1) (g)
method 3:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 0.000261775 0.002022637 0.12942 0.89702572
2. AR{1} 0.514859212 0.017233256 29.87591 0.00000000
3. MA{1} -0.023315871 0.020097899 -1.16011 0.24602977
1-ar(1)=0.5(g)
I simulate all three methods. The Theobold and Yallup(2004-journal of financial market),
they argue that this simulation model is estimated by ARMA(1,1) and partial adjustment
coefficient(g) interprete as 1-ar(1)coefficient. Table 1 is a results of Damodran(1993),
autocovariance ratio, and ARMA(1,1).
Here is Theobold and Yallup paper site.
http://www.sciencedirect.com/science/ar ... 7d1f0c3899
After doing simulation, I have a strange result. I think the third method is right.
Let me know what modify the other two codes getting the third method result.
Tom, If you can, please write simulation code to get result of table 1(simulation result) in Theobold and Yallup's paper.
The program is as follows.
all 10000
dec series p v
dec real mu g sigu sige
*
* Parameter settings
*
compute mu=.02,g=.5,sigu=.1,sige=.2
compute sw=%diag(||sigu^2,sige^2||)
*
* Method 1. If u and e are uncorrelated with each other, v is exogenous,
* so these can be drawn successively. This uses pre-sample values of 0
* for both.
*
set(first=0.0) v = v{1}+mu+%ran(sige)
set(first=0.0) p = p{1}+g*(v-p{1})+%ran(sigu)
BOXJENK(CONST,MAXL,AR=1,MA=1) P
*
* Method 2. Use SIMULATE. Again. This can accept any covariance matrix,
* which is input using the FACTOR option on SIMULATE. The P and V series
* are set because of the >>p and >>v on the GROUP instruction. This uses
* pre-sample values of 0 for both series.
*
frml h1 p = p{1}+g*(v-p{1})
frml h2 v = mu+v{1}
group padj2 h1>>p h2>>v
set p 1 10000 = 0.0
set v 1 10000 = 0.0
simulate(model=padj2,from=2,to=100,factor=%decomp(sw))
BOXJENK(CONST,MAXL,AR=1,MA=1) P
*
* Method 3. Use DSGE to create a state space model. This can accept any
* covariance matrix of u and e. This draws the data conditional only on
* one arbitrary value---the model has the two series cointegrated. With
* the other two methods, you need to discard a segment as "burn-in".
*
frml f1 = p-p{1}-g*(v-p{1})
frml f2 = v-v{1}
*
group padj f1 f2
*
dsge(model=padj,a=adlm,f=fdlm) p v
dlm(type=simulate,a=adlm,f=fdlm,sw=sw,presample=ergodic) 1 10000 xstates
*
* Pull out the p and v from the state vectors
*
set p 1 10000 = xstates(t)(1)
set v 1 10000 = xstates(t)(2)
BOXJENK(CONST,MAXL,AR=1,MA=1) P
Ths results is as follows.
method 1:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 19.56331429 161.00775380 0.12151 0.90329317
2. AR{1} 0.99999831 0.00001922 52019.08616 0.00000000
3. MA{1} 0.10517620 0.00996566 10.55386 0.00000000
1-ar(1) (g)
method 2:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 0.005381187 0.008599618 0.62575 0.53149509
2. AR{1} 0.968297100 0.002581308 375.11880 0.00000000
3. MA{1} -0.030926963 0.010343852 -2.98989 0.00279759
1-ar(1) (g)
method 3:
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. CONSTANT 0.000261775 0.002022637 0.12942 0.89702572
2. AR{1} 0.514859212 0.017233256 29.87591 0.00000000
3. MA{1} -0.023315871 0.020097899 -1.16011 0.24602977
1-ar(1)=0.5(g)
Re: simulation of paritial price adjustment
The 2nd method isn't working correctly because you're only simulating through TO=100, not TO=10000, so it's using mainly the data from the 1st method.
I forgot the mu term in the DLM method, so it should read:
I also patched the original code.
However, the reduced form model for P is an ARIMA(1,1,1) with a constant, not an ARMA(1,1) with constant. So you need to add the DIFFS=1 option to your BOXJENK instructions.
I forgot the mu term in the DLM method, so it should read:
Code: Select all
frml f1 = p-p{1}-g*(v-p{1})
frml f2 = v-v{1}-mu
*
group padj f1 f2
*
dsge(model=padj,a=adlm,f=fdlm,z=zdlm) p v
dlm(type=simulate,a=adlm,f=fdlm,z=zdlm,sw=sw,presample=ergodic) 1 10000 xstatesHowever, the reduced form model for P is an ARIMA(1,1,1) with a constant, not an ARMA(1,1) with constant. So you need to add the DIFFS=1 option to your BOXJENK instructions.
Re: simulation of paritial price adjustment
THANK YOU TOM.