Learn R Programming

jubilee (version 0.3.3)

jubilee.calc_cape: Internal utility to calculate n-year CAPE

Description

This CAPE calculator replicates the methodology of Shiller, so that one can calculate n-year CAPE, e.g. n=20. This utility has been calibrated by original 10-year CAPE data from Shiller.

Usage

jubilee.calc_cape(dtb, period, tol.frac = 1/6)

Arguments

dtb

data.table

period

numeric, the backward-looking regression period

tol.frac

numeric, tolerance of missing data in the beginning of the time series, expressed as fraction. Default is 1/6, that is, two months.

Value

numeric, the same length as dtb$fraction.

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
    dtb <- jubilee.repo(online=FALSE)@ie
    cape10 <- jubilee.calc_cape(dtb, 10)
    cape20 <- jubilee.calc_cape(dtb, 20)
  
# }

Run the code above in your browser using DataLab