rdj: Daily Returns of Three Stocks in the Dow Jones

rdjR Documentation

Daily Returns of Three Stocks in the Dow Jones

Description

Five years of daily log-returns (from 1996 to 2000) of Intel (INTC), Microsoft (MSFT) and General Electric (GE) stocks. These data were analysed in Chapter 5 of McNeil, Frey and Embrechts (2005).

Usage

data(rdj, package="copula")

Format

A data frame of 1262 daily log-returns from 1996 to 2000.

Date

the date, of class "Date".

INTC

daily log-return of the Intel stock

MSFT

daily log-return of the Microsoft stock

GE

daily log-return of the General Electric

References

McNeil, A. J., Frey, R., and Embrechts, P. (2005). Quantitative Risk Management: Concepts, Techniques, Tools. Princeton University Press.

Examples

data(rdj)
str(rdj)# 'Date' is of class "Date"

with(rdj, {
   matplot(Date, rdj[,-1], type = "o", xaxt = "n", ylim = .15* c(-1,1),
           main = paste("rdj - data;  n =", nrow(rdj)))
   Axis(Date, side=1)
})
legend("top", paste(1:3, names(rdj[,-1])), col=1:3, lty=1:3, bty="n")


x <- rdj[, -1] # '-1' : not the Date
## a t-copula (with a vague inital guess of Rho entries)
tCop <- tCopula(rep(.2, 3), dim=3, dispstr="un", df=10, df.fixed=TRUE)
ft <- fitCopula(tCop, data = pobs(x))
ft
ft@copula # the fitted t-copula as tCopula object
system.time(
g.C <- gofCopula(claytonCopula(dim=3), as.matrix(x), simulation = "mult")
) ## 5.3 sec
system.time(
g.t <- gofCopula(ft@copula, as.matrix(x), simulation = "mult")
) ## 8.1 sec



copula documentation built on Sept. 11, 2024, 7:48 p.m.