Data folder: /home/hatch/workspace/maineblock-products/data 

Step 1. The normal quantiles
Two-sided 5 percent: qnorm(0.975) = 1.959964 (the chapter carries 1.959964).
80 percent power: qnorm(0.80) = 0.841621. 50 percent power: qnorm(0.50) = 0.000000.

Step 2. Required counts at 80 percent power
Standardized effect 0.10: n = ((1.959964 + 0.841621) / 0.10)^2 = 784.9, about 785 observations.
Standardized effect 0.15: n = ((1.959964 + 0.841621) / 0.15)^2 = 348.8, about 349 observations.
Standardized effect 0.20: n = ((1.959964 + 0.841621) / 0.20)^2 = 196.2, about 196 observations.

Step 3. Power in percent, by effect size and count
        n = 60   n = 120   n = 240
d = 0.10    12.1      19.5      34.1
d = 0.15    21.3      37.6      64.2
d = 0.20    34.1      59.1      87.3

Step 4. Market calibration on dataset D1
Months: 1194. Mean 0.96 percent, standard deviation 5.30 percent, standardized effect 0.182 (prints as 0.18).
Power of a decade (n = 120) against the market's own effect: 51.1 percent.

Step 5. Years of monthly record required
Sharpe ratio 0.3 (correction factor 1.003750): 50 percent power 42.84 years (prints 43); 80 percent power 87.54 years (prints 88).
Sharpe ratio 0.5 (correction factor 1.010417): 50 percent power 15.53 years (prints 16); 80 percent power 31.72 years (prints 32).
Sharpe ratio 0.8 (correction factor 1.026667): 50 percent power 6.16 years (prints 6); 80 percent power 12.59 years (prints 13).

Step 6. Power of a ten-year record
Sharpe ratio 0.5 over ten years: 35.0 percent power. Sharpe ratio 0.8: 70.4 percent.

Step 7. Effective sample size of the overlapping series
Overlapping twelve-month returns: 1183 observations.
Autocorrelations, lags 1 to 11: 0.916 0.806 0.704 0.624 0.553 0.478 0.408 0.338 0.252 0.140 0.023 
Sum of the eleven autocorrelations: 5.24. Effective sample size: 103.
First-order approximation, n (1 - rho1) / (1 + rho1): 52. Theoretical-line value, n / 12: 98.6.
The monthly returns underneath carry a first autocorrelation of 0.090 of their own.

Step 8. Effective counts by window length (Figure 12.1)
Window 1 month: nominal count 1194, effective count 1194 (no overlap to correct).
Window 2 months: nominal count 1193, effective count 581.
Window 6 months: nominal count 1189, effective count 195.
Window 24 months: nominal count 1171, effective count 65.

Part B. Solution to the R companion lane: the second strategy
Excess return: nominal count 132; first autocorrelation +0.029; sum of eleven autocorrelations -0.133; effective sample size 180.
Total return: nominal count 132; first autocorrelation -0.120; sum of eleven autocorrelations -0.250; effective sample size 264.

Chapter 12 lab complete.
