代写代考 DAT 537 Assignment 6

DAT 537 Assignment 6

pdf_document:

Copyright By PowCoder代写 加微信 powcoder

latex_engine: xelatex

“`{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.

## 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?

## 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.

## 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?

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com