All changes from the original version circulated on Thursday 5th week are in red. DEGREE OF MASTER OF SCIENCE IN FINANCIAL ECONOMICS FINANCIAL ECONOMETRICS MICHAELMAS TERM 2020 COMPUTATIONAL ASSIGNMENT 1 PRACTICALWORK 2 November 2020 This assignment must be submitted before noon (12:00) Friday 7th Week (27 November 2020) by uploading to SAMS. This is individual work. All solutions must be submitted by the due date and time. Do not include your name on your submission. Candidates should answer all questions. Length: 4 pages (suggested); 5 pages (maximum). Material on pages 6+ will not be assessed. The limit does not include the cover sheet, academic honesty declaration, or submitted code files. All material, including figures, equations, and explanatory text, must fit within 5 pages. All changes from the original version circulated on Thursday 5th week are in red. Assessment This assignment is assessed in 3 parts: • 67% - Report. This report should focus on analysis and synthesis and not code or the numerical values of the problems. Tell a convincing story. • 33% - Autograder. 2 functions must be submitted to compute the required outputs using the inputs. The signature of each function is provided as part of the problem. You must exactly match the function name. Submissions must be in Python and must be in a single Python file (some_filename.py) containing all functions. IPython notebooks are not accepted. If using Python, pay close attention to the input and output dimensions. All data should be pandas DataFrames or Series, as indicated in the program description. Note: Please run your code in the function you submit to ensure that it does not produce an error. A function that produces an error is given a mark of 0. The autograder uses loose criteria when judging correctness and so any value within about 1% of the reference will be marked as correct. See the example file solutions.py for the structure of the file expected by the autograder. 2 turn over Preliminaries • Download daily data on the Value-Weighted Market, size, value, and momentum factors from Ken French’s website. Use data from the beginning of the common sample to the end of 2019. • Download daily data for the DAX, the Korea Composite Stock Price Index, and the Bovespa Index from Yahoo! Finance using the maximum date available. • Download daily data for two important currency pairs from FRED that are available from 1975 to the end of 2019. Your two pairs should involve four currencies. Hint: If needed, you can make rates by diving FX1/USD by FX2/USD to get FX1/FX2. • Download daily data for VBTLX from Yahoo Finance using the maximum date available. Assignment 1. Characterize the first four moments of these series at the daily, weekly, monthly, quarterly, and annual frequency. Focus on the similarities and differences across asset classes and sampling frequency. 2. Using 10-year subsamples, revisit your analysis in the previous problem for daily, weekly, monthly, and quarterly. Are your conclusion stable across sub-periods? 3. Using the full sample of data, estimate the degree of freedom parameter for a standardized Student’s t distribution for daily, weekly, monthly, and quarterly frequencies. Comment on how your estimates differ across frequency and asset class. You can either use Maximum Likelihood to jointly estimate the mean, variance, and degree-of-freedom (see the companion course for details) or moment-based estimators noting that the kurtosis of a Student’s tν is ν = 3 κ−2 κ−4 , κ > 4. Note: There was a bad typo in the formula above where κ and ν were switched in an earlier version of this problem set. Notes You can convert an arbitrary time series of returns to an as if price series using the relationship Pt = t∏ i=1 1+Rt t = 1,2 . . . where the initial price P0 = 1. The pandas methods resample, last (used with resample), and pct_change should simplify calculating across different frequencies substantially. 3 turn over Code Problems Summary Statistics for Different Sampling Intervals Produce a function that will compute the annualized mean, annualized standard deviation, skewness, and kurto- sis of a single pandas Series across sampling frequencies: daily, weekly, monthly, and quarterly. Use the factors 252, 52, 12, and 4 to annualize daily, weekly, monthly, and quarterly statistics to annual, respectively. stats = summary_statistics(prices) Outputs • stats - A pandas DataFrame with rows “mean”, “std”, “skew”, and “kurt” and columns “Daily”, “Weekly” (using Friday prices), “Monthly” (using end-of-month prices), and “Quarterly” (using end- of-quarter prices). The output should resemble: Daily Weekly Monthly Quarterly mean # # # # std # # # # skew # # # # kurt # # # # Inputs • prices - A pandas Series with shape n. The input data will be daily price data. Student’s t Degree of Freedom Calculation Estimate the degree of freedom parameter ν using MLE and the moment-based estimator given the mean is 0 and the variance is 1. mle, moment = students_dof(returns) Outputs • mle - Scalar float. The MLE of the degree of freedom parameter. If you are unsure how to compute this value, return NaN for partial credit on this problem. • moment - Scalar float. The moment-based estimator of the degree of freedom parameter. If the kurtosis is less than or equal to 4, you should return inf. Inputs • returns - A pandas Series with shape n. The returns will have been standardized to have mean 0 and variance 1. 4 turn over Notes The MLE can be calculated by evaluating the log-likelihood on a fine grid of values for ν (i.e., every 0.01), and then reporting the value that maximizes the log-likelihood. Alternatively, you can follow the companion course and estimate the parameter using numerical methods where the mean is fixed to 0, and the variance is set to 1. You should use the standardized Student’s t likelihood in this problem. This version of the Student’s t has three parameters, the mean, the variance and the degree of freedom. The usual Student’s t only has a single degree of freedom parameter ν that determines all even moments. The mean and all odd moments are 0 (when they are finite). 5 last page
欢迎咨询51作业君