程序案例-E471/M504-Assignment 1

E471/M504: Econometric Theory and Practice I Fall 2021 Assignment 1 Due: Thursday 9th September, 2021, 3:15 pm Instructions: Please upload an electronic copy of your answers to Canvas combining all results in one pdf/word file. If there is any handwritten part, please scan it and include it with the rest of the answers. Please also upload your code to Canvas before the due time. The code accounts for 50% of the points of the empirical questions. You are allowed to collaborate in groups, but required to write up answers and code independently. Direct copying will be treated as cheating. Please write the names of your collaborators at the beginning of your work, if any. If you cannot make it to the discussion session, please let me know at least one day before the due time, and you will be randomly assigned to present your answer to some questions one day before the due time and upload your presentation video to the Discussion board on Canvas before the due time (for the “Presentation” part of the course requirement). Questions: 1. Download the file Assignment1Data.csv, which contains three series: CITCRP, MAR- KET, and RKFREE with data from January 1978 to December 1987. All three files contain monthly returns: on the Citicorp stock rc, a market portfolio rm, and a risk-free bond rf . (a) Write an R chunk that loads the data. (b) Compute means and standard deviations for the three series. Is the average return on the market portfolio smaller or larger than the average return on the risk-free bond Which series is more volatile (c) What are the units of your returns Are they reported in percentages Are they month-on-month or are they annualized Hint: you might want to gather some interest data on either a 30-day Treasury Bill or the Federal Funds rate with are typically reported in annualized percentages and compare them to the bond returns. To obtain data, try googling “FRED FRB St Louis” (d) The three series are time series, i.e., each observation is associated with a particular month and year. To convert them into time series in R use CITICORP.ts <- ts(data$CITICORP, frequency = 12, start = c(1978,1)) Market.ts <- ts(data$Market, frequency = 12, start = c(1978,1)) Riskfree.ts <- ts(data$Riskfree, frequency = 12, start = c(1978,1)) (e) Create a plot that overlays the market return and the bond return. Try the time series plot command in R plot.ts(cbind(Market.ts, Riskfree.ts), plot.type = "single") Discuss the resulting graph. (f) Compute and plot the excess returns on the Citicorp stock and the market portfolio: rc rf and rm rf . Here we are measuring returns in excess of the risk-free rate. Compute sample means and standard deviations for the excess returns. (g) Now estimate the regression rc,i rf,i = β0 + β1(rm,i rf,i) + 2i (1) Report coefficient estimates β j and estimates of the standard errors σ β j associated with the coefficient estimators. (h) The capital asset pricing model (CAPM) suggests that β0 should be zero. Are your estimates in agreement with the CAPM A casual answer suffices. Page 2 2. Consider the following regression model without intercept Yi = βXi + Ui, (2) where (Xi, Ui) are independent and identically distributed. In addition to the OLS estimator β M = 1 n ∑n i=1 XiYi 1 n ∑n i=1 X 2 i (3) consider the following alternative estimator for β: β M = 1 n ∑n i=1 Yi 1 n ∑n i=1 Xi . (4) The goal is to compare the sampling properties of the two estimators. Design a small simulation experiment to explore the properties of β M following the notes in Slides 5. Assume that the “true” β = 1, let Xi ~ N(1, 1), and Ui|Xi ~ N(0, 1). The R chunk should look like. set.seed(123,kind="default",normal.kind="default") n <- c(10,50,100,1000) beta <- sigu <- sigx <- nrep <- 500 par(mfrow=c(4,2),mar=c(2.2,2.2,2.2,2.2)) for(j in 1:4){ betahat <- rep(0,nrep) betastar <- rep(0,nrep) for(i in 1:nrep){ u <- rnorm(n[j], mean=0, sd=sigu) x <- rnorm(n[j], mean= , sd=sigx) y <- beta*x + u olsresult <- lm( y ~ x - 1) betahat[i] <- olsresult$coeff betastar[i] <- } Page 3 hist(betastar,plot=TRUE,xlab="beta_star",xlim=c(0,2), main=paste("n = ", n[j])) hist(betahat,plot=TRUE,xlab="beta_hat",xlim=c(0,2), main=paste("n = ", n[j])) } You need to replace the by the appropriate code. To compute the estimator notice that the estimator is defined as the ratio of two means. Check out the function mean() in R. Explain the output of your R program. Which estimator appears to be preferable Page 4