I'm studying overreactions in the BVSP index and I need to check if after these reactions the return (R) reverts to the mean and in how many days. I started now, but I didn't find practical material regarding mean reversion. Can anyone help me with any tips?
Command used to capture and calculate exaggerated reactions signaled by dummy:
clear
getsymbols ^BVSP, fy(1993) freq(d) yahoo clear price (adjclose)
rename period refdate
rename r__BVSP R
sort refdate
gen R_1 = R[_n-1]
gen R_2 = R[_n-2]
gen R_3 = R[_n-3]
gen R_4 = R[_n-4]
gen R_5 = R[_n-5]
egen R_avg5 = rowmean (R_1 R_2 R_3 R_4 R_5)
egen R_sd5 = rowsd(R_1 R_2 R_3 R_4 R_5)
gen avg_sd2_5 = R_avg5 + (2 * R_sd5)
gen R_abs = .
gen R_n = R
drop R
replace R_abs = abs(R_n)
rename R_abs R
gen d_R_5 = 1 if R > avg_sd2_5
replace d_R_5 = 0 if R < avg_sd2_5
drop R
rename R_n R
Greetings
Related Posts with Reversion mean after overreactions
Help with Tabout One-way tableHello, I would like to make a simple summary statistic table describing 3 merges. I just renamed th…
entropy and missing valuesThe number of non-missing values varies with cases. For example, as shown in the below table, a has …
Reshape long multiple variables error invalid "var" 198Hi all, I am having trouble with the reshaping long command. I have read the previous posts, but I w…
sdmxuse error with OECD APII have a strange error with "sdmxuse" command. I used the same code a week ago with no issues. Now I…
Problem with margins after regression with cubic spline interaction termsHello, I am working on a longitudinal study looking for differences between two groups in the depen…
Subscribe to:
Post Comments (Atom)
0 Response to Reversion mean after overreactions
Post a Comment