Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem:(20points) Using theRcode(posted below) download five years of daily stock prices for AAPL (2015-2019). Compute the standard deviation and kurtosis of the log-returns at i)

Problem:(20points)

Using theRcode(posted below) download five years of daily stock prices for AAPL (2015-2019). Compute the standard deviation and kurtosis of the log-returns at i) daily, ii) weekly and iii) monthly lags. Make a table with the results and discuss them: what is the trend?

How are these results connected to the stylized property of the financial markets known asAggregational Gaussianity?

library(quantmod)

library(PerformanceAnalytics)

rm(list=ls())

options("getSymbols.warning4.0"=FALSE)

#getSymbols("^GSPC",from="2018-01-01", to="2019-12-30") #Creates the time series object GSPC

getSymbols("XOM",from="2015-01-01", to="2019-12-30") #Creates the time series object GSPC

getSymbols("JPM",from="2020-12-01", to="2021-01-14") #Creates the time series object GSPC

names(XOM)#[1]Open, [2]High, [3]Low [4] Close [5]Volume

head(XOM)

tail(XOM)

tkr <- JPM

plot(Cl(tkr))

tail(tkr)

# compute log-returns

ret.d = periodReturn(tkr,period="daily",type="log")

ret.w = periodReturn(tkr,period="weekly",type="log")

ret.m = periodReturn(tkr,period="monthly",type="log")

ret.d <- ret.d[!is.na(ret.d)]# Remove missing values, if needed

plot(ret.d,main="Daily log returns")

qqnorm(ret.d,main="Q-Q plot")

av.ret.d <- mean(ret.d)

sd.ret.d <- sd(ret.d)

k.ret.d <- kurtosis(ret.d, method="excess")

data.d <- data.frame(av.ret.d, sd.ret.d, k.ret.d)

data.d

ann.vol <- sd.ret.d*sqrt(252)

av.ret.w <- mean(ret.w)

sd.ret.w <- sd(ret.w)

k.ret.w <- kurtosis(ret.w, method="excess")

data.w <- data.frame(av.ret.w, sd.ret.w, k.ret.w)

data.w

av.ret.m <- mean(ret.m)

sd.ret.m <- sd(ret.m)

k.ret.m <- kurtosis(ret.m, method="excess")

data.m <- data.frame(av.ret.m, sd.ret.m, k.ret.m)

data.m

6.5*12

12*5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

A First Course In Differential Equations

Authors: J David Logan

3rd Edition

3319178520, 9783319178523

More Books

Students also viewed these Mathematics questions

Question

When would the ROI of training be a useful measure? Explain.

Answered: 1 week ago

Question

1. To understand how to set goals in a communication process

Answered: 1 week ago