Dear Statalisters,
I wonder if you would have time to answer the following questions. I
am trying to perform -lomackinlay- (Lo and MacKinlay, 1988) variance
ratio test with bootstrap. The usual procedure would involve the
following steps:
1. Draw a bootstrap sample of N observations r*(t), t=1..N, with
replacement from the empirical distribution of one-period returns,
r(t).
1a. For each t, draw a weighting factor z*(t), t=1..N, with
replacement from the empirical distribution of normalized returns
z(t)= [r(t) - mean]/sd
1b. Form the bootstrap sample of N observations r*(t) = z*(t)r(t),
t=1..N, by multiplying observation of actual returns with its
corresponding random weighting factor.
2. Calculate the VR*(k) from the pseudo data r*(t) for k=1..K
3. Repeat steps 1 and 2 M times obtaining VR*(k,m) , m=1..M
To test the null of a random walk one can compare the observed
VR(q) statistic with the quantiles of the sampling distribution. Mean
reverting processes would have a VR(q) statistic lower than the
5%-quantile while mean averting processes would have a VR(q) statistic
higher than the 95%-quantile.
If the program below is correct (it's my first time) then does it mean
that inferences should be made by comparing VR (=1.976 here) computed
using log of index values (as in -lomackinlay- helpfile) with those
found in -estat bootstrap- table under the heading "normal CI"?
Is it appropriate to set -bsample- equal to the total no. of
observations in this case?
Regards
-----------------------------------------------
use "rts-daily.dta", clear
*Step 1
gen rtsiday2 = log(rtsiday)
tabstat rtsiday2, s(mean, sd)
gen rtsiday2z = (1/0.9153548)*(rtsiday2-5.751905)
gen rtsiday2bs = rtsiday2*rtsiday2z
lomackinlay rtsiday2bs, q(56)
scalar xxx = r(v_56)
*Step 2
capture program drop vrsim
program define vrsim, rclass
preserve
bsample
gen tnew = _n
tsset tnew
lomackinlay rtsiday2bs, q(56)
scalar v_56 = r(v_56)
restore
end
*Step 3
simulate v56=v_56, reps(1000): vrsim
bstat, stat(xxx) n(1000) l(99)
estat bootstrap, all
-----------------------------------------------
. estat bootstrap, all
Bootstrap results Number of obs = 1000
Replications = 1000
------------------------------------------------------------------------------
| Observed Bootstrap
| Coef. Bias Std. Err. [99% Conf. Interval]
-------------+----------------------------------------------------------------
v56 | 1.6400484 -1.618944 .00067033 1.638322 1.641775 (N)
| .0194108 .0228126 (P)
| . . (BC)
------------------------------------------------------------------------------
(N) normal confidence interval
(P) percentile confidence interval
(BC) bias-corrected confidence interval
. lomackinlay rtsiday2, q(56)
Lo-MacKinlay modified overlapping Variance Ratio statistic for rtsiday2
[ 1 - 2898 ]
q N VR R_s p>|z|
--------------------------------------------------
56 2842 1.976 6.0591 0.0000
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/