Package 'qrmdata'

Title: Data Sets for Quantitative Risk Management Practice
Description: Various data sets (stocks, stock indices, constituent data, FX, zero-coupon bond yield curves, volatility, commodities) for Quantitative Risk Management practice.
Authors: Marius Hofert [aut, cre], Kurt Hornik [aut], Alexander J. McNeil [aut]
Maintainer: Marius Hofert <[email protected]>
License: GPL-2 | GPL-3
Version: 2024-03-04-2
Built: 2025-01-24 03:41:21 UTC
Source: https://github.com/cran/qrmdata

Help Index


Commodity Data

Description

Data sets containing commodities.

Usage

data("OIL_Brent")
data("GOLD")

Format

xts objects containing the Brent Crude price in USD per barrel (for OIL_Brent) and the World Gold Council gold price in USD per troy ounce (for GOLD).

Author(s)

Marius Hofert

Source

The data was obtained from Federal Reserve Economic Data (FRED) via Quandl on 2016-01-03 with the function get_data() from qrmtools.

Examples

data("OIL_Brent")
data("GOLD")

Cryptocurrency Prices in USD

Description

Bitcoin, Ethereum, Litecoin and Ripple prices in USD (from their first available date onwards).

Usage

data("crypto")

Format

xts object containing cryptocurrency prices in USD of Bitcoin (ticker symbol “BTC-USD”), Ethereum (ticker symbol “ETH-USD”), Litecoin (ticker symbol “LTC-USD”) and Ripple (ticker symbol “XRP-USD”) from their first available date onwards.

Author(s)

Marius Hofert

Source

The data was obtained from Yahoo Finance on 2018-05-29 via the function get_data() from qrmtools.

Examples

data("crypto")
str(crypto)
library(xts)
plot.zoo(crypto, main = "Cryptocurrencies in USD", xlab = "Time")

Standard & Poor's Default Data

Description

A three-dimensional array containing the default data for A-, BBB-, BB-, B- and C-rated companies for the years from 1981 to 2000.

Usage

data("SP_defaults")

Format

xts objects containing foreign exchange rates of Canadian Dollar (CAD_*), US Dollar (USD_*), British Pound (GBP_*), Euro (EUR_*), Swiss Francs (CHF_*), Japanese Yen (JPY_*), Chinese Yuan (CNY_*) with respect to USD (*_USD) and GBP (*_GBP) from 2000-01-01 to 2015-12-31.

Author(s)

Marius Hofert

Source

Standard & Poor's Credit Monitor

Examples

data("SP_defaults")

Foreign Exchange Rate Data

Description

Foreign exchange rate data with respect to USD and GBP.

Usage

data("CAD_USD")
data("GBP_USD")
data("EUR_USD")
data("CHF_USD")
data("JPY_USD")
data("CNY_USD")
data("CAD_GBP")
data("USD_GBP")
data("EUR_GBP")
data("CHF_GBP")
data("JPY_GBP")
data("CNY_GBP")

Format

xts objects containing foreign exchange rates of Canadian Dollar (CAD_*), US Dollar (USD_*), British Pound (GBP_*), Euro (EUR_*), Swiss Francs (CHF_*), Japanese Yen (JPY_*), Chinese Yuan (CNY_*) with respect to USD (*_USD) and GBP (*_GBP) from 2000-01-01 to 2015-12-31.

Details

Interpretation: As an example, EUR_USD contains the EUR/USD exchange rate, so a value xx in EUR_USD indicates that 1 EUR is worth xx USD at that point in time.

Author(s)

Marius Hofert

Source

The data was obtained from OANDA (https://www.oanda.com/) on 2016-01-03 via the function get_data() from qrmtools.

Examples

data("CAD_USD")
data("GBP_USD")
data("EUR_USD")
data("CHF_USD")
data("JPY_USD")
data("CNY_USD")
data("CAD_GBP")
data("USD_GBP")
data("EUR_GBP")
data("CHF_GBP")
data("JPY_GBP")
data("CNY_GBP")

Interest-Rate Data

Description

Zero-coupon bond yield curves in CAD and USD.

Usage

data("ZCB_CAD")
data("ZCB_USD")

Format

ZCB_CAD:

xts object containing, in each row, zero-coupon bond yield curves in percent for 120 times to maturity (ranging from 0.25 to 30 years); only trading days from 1991-01-02 to 2015-08-31 with available values for all maturities are included.

ZCB_USD:

xts object containing, in each row, zero-coupon bond yield curves in percent for 30 times to maturity (ranging from 1 to 30 years); only trading days from 1985-11-25 to 2015-12-29 with available values for all maturities are included.

Author(s)

Marius Hofert

Source

ZCB_CAD was created from data obtained from https://www.bankofcanada.ca/rates/interest-rates/bond-yield-curves/ multiplied by 100. ZCB_USD was obtained from https://data.nasdaq.com/data/FED/SVENY-us-treasury-zerocoupon-yield-curve/ (active in 2016) via Quandl. Both data sets were drawn on 2016-01-03 (ZCB_USD via the function get_data() from qrmtools).

Examples

data("ZCB_CAD")
data("ZCB_USD")
mat <- as.matrix(ZCB_USD['2015-01-01/2015-12-31',])
df <- data.frame(Day = rep(1:nrow(mat), each = ncol(mat)),
                 Maturity = rep(1:ncol(mat), nrow(mat)),
                 Value = as.vector(t(mat)))
lattice::wireframe(Value ~ Day * Maturity, data = df,
                   alpha.regions = 0.5,
                   scales = list(arrows = FALSE, col = "black"),
                   par.settings = list(axis.line = list(col = "transparent")))

Loss Datasets

Description

Danish fire insurance claims in 1M DKK in Denmark from 1980-01-03 to 1990-12-31. Largest 1% of simulated losses of Norwegian bank DNB.

Usage

data("fire")
data("DNB")

Format

fire:

univariate xts object with 2167 observations.

DNB:

(25000, 3)-matrix containing the largest 1% of simulated (market risk, credit risk, asset risk) losses of DNB; see Aas and Puccetti (2014, Section 2).

Author(s)

Marius Hofert

Source

fire:

Originally Mette Rytgaard (Copenhagen Re).

DNB:

Originally Kjersti Aas and Giovanni Puccetti.

References

Aas, K. and Puccetti, G. (2014). Bounds for total economic capital: the DNB case study. Extremes 17(4), 693–715.

Examples

library(xts)
## Danish fire losses
data("fire")
str(fire)
stopifnot(inherits(fire, "xts"), length(fire) == 2167)
plot.zoo(fire, ylab = "Fire insurance claim")

## Largest 1% of simulated DNB losses
data("DNB")
stopifnot(dim(DNB) == c(25000, 3))

(Single) Stock Data

Description

Single stock data; only Radioshack at the moment.

Usage

data("RSHCQ")

Format

An xts object containing adjusted close prices of Radioshack (RSHCQ; ticker symbol “RSHCQ”) from 1982-01-04 to 2015-01-20.

Author(s)

Marius Hofert

Source

Radioshack defaulted early 2015. Yahoo Finance did not provide adjusted close prices thereafter. We thus used the adjusted close prices from 1982-01-04 to 2015-01-20 which we drew from Yahoo Finance on 2015-01-21 via the function get_data() from qrmtools.

Examples

data("RSHCQ")

Stock Index Data

Description

Single stock indices.

Usage

data("SP500")
data("DJ")
data("NASDAQ")
data("FTSE")
data("SMI")
data("EURSTOXX")
data("CAC")
data("DAX")
data("CSI")
data("HSI")
data("SSEC")
data("NIKKEI")

Format

xts objects containing adjusted close prices of the S&P 500 (SP500; ticker symbol “^GSPC”), Dow Jones (DJ; ticker symbol “^DJI”), NASDAQ 100 (NASDAQ; ticker symbol “^NDX”), FTSE 100 (FTSE; ticker symbol “^FTSE”), Swiss Market Index (SMI; ticker symbol “^SSMI”), Euro Stoxx 50 (EURSTOXX; ticker symbol “^STOXX50E”), Cotation Assistée en Continu (CAC; ticker symbol “^FCHI”), Deutscher Aktienindex (DAX; ticker sybmol “^GDAXI”), China Securities Index (CSI; ticker sybmol “000300.SS”), Hang Seng Index (HSI; ticker symbol “^HSI”), Shanghai Stock Exchange Composite Index (SSEC; ticker symbol “000001.SS”) and the NIKKEI (NIKKEI; ticker symbol “^N225”) from their first date of availablility to 2015-12-31.

Author(s)

Marius Hofert

Source

The data was obtained from Yahoo Finance on 2016-01-03 via the function get_data() from qrmtools.

Examples

data("SP500")
data("DJ")
data("NASDAQ")
data("FTSE")
data("SMI")
data("EURSTOXX")
data("CAC")
data("DAX")
data("CSI")
data("HSI")
data("SSEC")
data("NIKKEI")

Stock Index Constituents Data

Description

Constituent data of various stock indices.

Usage

data("SP500_const")
data("DJ_const")
data("FTSE_const")
data("EURSTX_const")
data("HSI_const")

Format

xts objects containing adjusted close prices of the constituents of the respective stock indices. These are the S&P 500 constituents (SP500_const with corresponding Global Industry Classification Standard (GICS) information SP500_const_info; see https://en.wikipedia.org/wiki/List_of_S%26P_500_companies; given these tickers, the data was obtained from Yahoo! Finance) as of 2015-10-12, the Dow Jones constituents (DJ_const; information about the constituents not available anymore) as of 2016-01-03, the FTSE 100 constituents (FTSE_const; see https://uk.finance.yahoo.com/quote/%5EFTSE/components?ltr=1/) as of 2016-01-03 (the data was only available for 98 constituents), the Euro Stoxx 50 constituents (EURSTX_const; see https://uk.finance.yahoo.com/quote/%5ESTOXX50E/components?ltr=1/) as of 2016-01-03 (the data was only available for 98 constituents) and the Hang Seng Index constituents (HSI_const; see https://uk.finance.yahoo.com/quote/%5EHSI/components?ltr=1/) as of 2016-01-03.

The constituents data ranges from the first date at least one of the constituents is available (with missing data if not available) to 2015-12-31.

Author(s)

Marius Hofert

Source

The data was obtained from the respective URLs on 2016-01-03 via the function get_data() from qrmtools.

Note that for the S&P 500 constituents, the data was rounded to two decimal places to reduce the file size of the data set.

Examples

data("SP500_const")
data("DJ_const")
data("FTSE_const")
data("EURSTX_const")
data("HSI_const")

Volatility Index

Description

Chicago Board Options Exchange (CBOE) volatility index (VIX) data.

Usage

data("VIX")

Format

An xts object containing the volatility index (VIX; ticker symbol “^VIX”) from its first date of availablility to 2015-12-31.

Details

The VIX is typically used as a market-based measure of volatility in percent.

Author(s)

Marius Hofert

Source

The data was obtained from Yahoo Finance on 2016-01-03 via the function get_data() from qrmtools.

Examples

data("VIX")