converting quantity of Treasury debt maturity remaining to time series
Treasury_Maturity_Short_term_rate <- read_excel("Treasury_Maturity_Short_term_rate.xlsx")
View(Treasury_Maturity_Short_term_rate)
df <- Treasury_Maturity_Short_term_rate
df$`Short-term` <- ts(df$`Short-term`, start = c(1999, 1), end = c(2021,7), frequency = 12)
df$Medium <- ts(df$Medium, start = c(1999,1), end = c(2021,7), frequency = 12)
df$`Long-term` <- ts(df$`Long-term`,start = c(1999,1), end = c(2021,7), frequency = 12)
attach(df)
plot(`Short-term`)

plot(Medium)

plot(`Long-term`)

plot(Average1)

plot(Average2)

Converting quantity of treasury debt maturity remaining to stattionary data
TQd <- df[, 1:4]
attach(TQd)
## The following objects are masked from df:
##
## Date, Long-term, Medium, Short-term
lSR <- 100*log(`Short-term`)
lmd <- 100 *log(Medium)
lLR <- 100* log(`Long-term`)
SR.growth.lSR <- diff(lSR)
Md.growth.lmd <- diff(lmd)
LR.growth.lLR <- diff(lLR)
plot(SR.growth.lSR)

plot(Md.growth.lmd)

plot(LR.growth.lLR)

Finding the best model to be use for the arima model
acf_SR <- acf(SR.growth.lSR, lag.max = 12)

pacf_SR <- pacf(SR.growth.lSR, lag.max = 12)

acf_Md <- acf(Md.growth.lmd, lag.max = 12)

pacf_Md <- pacf(Md.growth.lmd, lag.max = 12)

acf_LR <- acf(LR.growth.lLR, lag.max = 12)

pacf_LR <- pacf(LR.growth.lLR, lag.max = 12)
