首页 > > 详细

32022 Assignment 2

 ---

title: "Assignment 2"
author: "Your Name"
date: "October 30, 2022 (due November 6, 2022)"
output: pdf_document
---
 
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
 
Note: This is an individual assignment. No discussion with a fellow student is allowed. Honor code is in place.
 
Use the getfinmdat() function in the cbw library to download monthly excess returns on amazon (ticker symbol AMZN) and the sp500 index (ticker synbol ^gspc) from 2010-01-01 to 2022-05-31. Call the downloaded object datdf. Use the data in datdf for Questions 1-2. Use a trainsize of 24 in answering each question.
 
```{r}
# write your code here
 
 
```
 
 
## Question 1
 
Suppose you are interested in comparing the FF3 and FF5 models with Gaussian errors to explain the excess returns of Amazon stock.  Explain how you would do that (assume in each case that the FF3 and FF5 factors price prmamazon). Which model is better? And at what level of posterior odds? 
 
```{r}
# write your code here
 
 
 
```
 
 
## Question 2
 
Now suppose that you do the same comparison but with student-t errors. For each model you decide to find the best value of nu (the degrees of freedom) on the grid nug = 10:25. What is your conclusion now?  Again use a trainsize of 24.
 
```{r}
# write your code here
 
 
```
## Question 3
 
1. Suppose you want to see if the logmarglik can find the correct degrees of freedom in student-t regression.  You generate n = 500 observations (seed = 301) from the regression model y = alpha + beta*x + e, where the x variable has a uniform distribution on (0,1), alpha = 1, beta = -.5 and e is student t with mean zero, tausq = 1 and nu = 3.5. After generating the data on the outcome y from this model you fit several student-t regression models on the grid of nu values given by {3,3.5,4,4.5,5,5.5}. What do you find? Use the default training sample prior. Is the correct model discovered by the log marginal likelihood?
 
```{r}
# write your code here
 
 
```
 
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!