require("tframe")
data("CanadianMoneyData", package="CDNmoney")
cat("################ Calculations to get monetary aggregates
")
M1gross <- tframed(MB2001 + MB486 + MB487p + TMLinterbank, names="gross M1 (B2054)")
M1p <- tframed(MB2001 + MB486 + MB487p + MB452 + MB452adj + MB472
+ NonbankCheq, names="M1+ (B2060)")
M1pp <- tframed(CUadj + M1p + MB453 + MB473 + MB473adj + NonbankNonCheq,
names="M1++ (B2061)")
M2 <- tframed(M1total + MB472 + MB473 + MB452 + MB453 + MB454, names="M2 (B2031)")
M2p <- tframed(M2 + NonbankCheq + NonbankNonCheq + NonbankTerm
+ MB2046 + MB2047 + MB2048, names="M2+ (B2037)")
M2pp <- tframed(M2p + MB2057 + MB2058, names="M2++ (B2059)")
M3 <- tframed(M2 + MB475 + MB482, names="M3 (B2030)")
cat("################ Calculations of cpi and pop
")
# M1real = M1total * 100/p100000 (CPI - p20 Bank of Canada Weekly Financial
# Statistics, June 1992=100)
# M1PerCapita = M1total * 100 /(pop * p100000) # using a quarterly population
# series converted to monthly using spline.
cpi <- 100 * M1total / M1real
seriesNames(cpi) <- "CPI"
popm <- M1total / M1PerCapita
seriesNames(popm) <- "Population of Canada"
cat("################ Plot aggregates
")
tfplot(tbind(M1total, M1gross, M1p, M1pp))
tfplot(tbind(M1PerCapita, M1real))
tfplot(tbind(M2, M2p, M2pp))
tfplot(M3)
cat("######## Calculations to get components as used in Gilbert and Pichette
")
z <-tfwindow(tframed(tbind(
MB2001,
MB486 + MB452 ,
NonbankCheq,
MB472 + MB473 + MB487p,
MB475,
NonbankNonCheq + MB454 + NonbankTerm + MB2046 + MB2047 + MB2048 +
MB2057 + MB2058 + MB482 + MB453),
names=c("currency", "personal cheq.", "NonbankCheq",
"N-P demand & notice", "N-P term", "Investment")
), start=c(1986,1), end=c(2002,4))
MBcomponents <- 1e8 * z /matrix(tfwindow(popm * cpi, start=c(1986,1),
end=c(2002,4)),196, 6)
# 1e8 * gives real $ per person
#(MB numbers in millions, CPI in fraction*100, popm in persons.)
tfplot(MBcomponents, graphs.per.page=3)Run the code above in your browser using DataLab