STAT 411/616 Homework 4
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
STAT 411/616
Homework 4 – Bootstrap
Rules
The report for the assignment should be in a single .pdf file, uploaded to Canvas with hard copy to the TA at or before the due date and time. Your report must include:
A cover page with name, class, assignment number, and date;
All of the code you used to solve each problem, along with RELEVANT output. You can include this as part of the body of the report, or (preferably) you can put all of the code in an appendix of the report. Do not include incorrect code or error messages, unless they are related to some point you are raising in your discussion. All code/output must be in a monospace font (not proportional);
Handwritten or typed mathematic derivations or proofs if needed;
Any graphs that you used in answering the question. See R's help facility or go to the site https://statistics.berkeley.edu/computing/saving-plots-r for information on saving graphs from R in a form that can be incorporated into your report;
A written description of your conclusion for each question asked in the assignment.
Assignment overview
This assignment has 4 problems with 1 additional STAT 616-only problem.
1. Design your own bootstrap subroutine/function. Be sure and include a plotting option and options for outputting parametric or non-parametric bootstrap confidence intervals. Test this1 on the excess kurtosis of Town.A in the dataset TwoTowns.csv in Canvas Files/Data. In calculating your kurtosis, you should use an unbiased estimator such asγˆ2 = g2 = − 3 . The lognormal distribution is reasonable to assume for the parametric function.
2. For n=5, 25 and 50, take a random sample from an Expo(1) density, and bootstrap the sample mean X using a bootstrap size B=200, using both the canonical (non-parametric) bootstrap and the natural parametric bootstrap.
a. Derive the exact distribution of X .
b. Obtain the CLT limiting distribution of X .
c. Construct the corresponding histograms and superimpose them on the exact density. Discuss any unusual findings/discrepancies.
3. In finance, the compound annual growth rate (CAGR) is an equivalent annual growth rate needed to achieve a given terminal value N periods in the future. Each year's return is calculated as Rt =Pt/Pt-1 and is quoted in “gross” return form. I.e., Rt=1.05 represents a 5% increase over the prior year, and
Rt=.97 represents a 3% loss. One calculates the terminal value as RT = ∏ Rt , assuming R0=1.0. To
=1
obtain the CAGR one calculates the geometric average of the gross returns minus one (or, equivalently,
analytical expression for its standard error σr * . However, in many trading or investing applications we have portfolio strategies which purport to generate long-run CAGR’s which we compare to the market benchmarks’ CAGR’s. In order to determine if a strategy outperforms an index, we need the standard error of the CAGR.
The data is in Canvas/Files/Data as 93years.NYSE_AMEX_NASDAQ.1926-2018.csv. Data are annual returns from 1926 thru 2018 for the NYSE stock market (about 5,000 stocks). Variable names are caldt (date), vwretd (market-cap weighted return with dividends), and ewretd (equal-weight return with dividends). Note that these latter returns are provided in gross returns suitable for multiplication so you will not need to add one to the percent returns.
a. Find the CAGR’s for vwretd and ewretd. Do these returns reinforce the notion that long-run stock market total returns are about 10% per year?
b. Using the non-parametric bootstrap and resampling with replacement from the 93 years of market returns, obtain the standard errors of the vwretd and ewretd CAGR’s. You should experiment with various values of bootstrap replicates, B.
c. Compare the two CAGR’s and determine whether any difference is statistically significant.
4. In this problem we explore the correlation between GOOG's and BIDU's volume and price, as well as price return correlation between the two stocks. In Canvas Files/Data you will find BIDU.2010- 2018.csv and GOOG.2014-2018.csv. We will investigate the correlation between the changes (log returns) in price and volume for the two stocks. Since these stocks have experienced splits during the study period, you will need to divide price and multiply volume by the variable CFACPR. You will then need to calculate the log return of price and volume for each day in the files, and then calculate the correlation between price and volume changes over the study period. For example,
rvol ,t = log(volt / volt−1 ) . We calculate the returns to avoid the spurious correlation of the time variable in the time series.
We will also be investigating the correlation between GOOG and BIDU stock price (log) changes. You will need to make sure your dates synchronize. Calculate the log price returns for each stock, and then calculate the correlation coefficient between these returns. Don't forget to normalize the prices by the appropriate CFACPR.
There are two parametric hypothesis tests of correlation2, one testing for zero correlation (using a t pivot), and the other for general correlation. The latter test uses Fisher's Z transform, which can also provide a confidence interval for the correlation.
a. Perform hypothesis tests on the correlation of price/volume and GOOG/BIDU price changes and report your findings. Also obtain the parametric confidence interval based on the Z- transform. Note that the R function cor.test will provide the asymptotic confidence interval, but you should calculate it manually also.
b. Also find bootstrap confidence intervals for all three correlations. Make naive as well as ECDF percentile confidence intervals. Compare the two intervals, using length, and discuss any differences. You should comment on the empirical distribution of the correlation coefficients and how these may impact your intervals.
STAT 616 Students:
5. Investigate the correlation for price and volume for BIDU and GOOG using one-day lagged volume. Compare with unlagged correlation. Obtain confidence intervals for these correlations also.
2023-03-09