This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################ | |
####################### READING THE RELEVANT FILES ######################################### | |
train.data <- read.csv("train_sample.csv") | |
## Set seed for reproducing the random numbers | |
set.seed(10001) | |
## This is to confirm the selection of trade_price_last{1-10} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specifying functions: | |
CalcResiduals <- function(th, data) { | |
# Calculates the e_t and h_t for the GARCH(1, 1) model with given parameters. | |
# | |
# Argumentss: | |
# th: Parameters | |
# th[1] -> mean | |
# th[2] -> alpha.0 | |
# th[3] -> alpha.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data <- read.csv("IFE_Update.csv") | |
# Plotting the foreign reserves of all the countries | |
png("IR_Relative.png", height = 800, width = 1000) | |
par(mfrow = c(3, 2)) ## This is to specify the number of rows and columns you want for the plots | |
# India | |
plot(data$Index, (data$India.Millions/max(data$India.Millions[!is.na(data$India.Millions)])), | |
type="l", xlab= "Months", ylab= "Foreign reserves (in $ millions)", col="green", lwd = 2, | |
main ="India's foreign reserves since 2002") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- read.csv("Data.csv") | |
# Pretty functions to compute the MOM and YOY inflation rates | |
mom.inf <- function(series){ | |
x <- rep(NA,length(series)) | |
for(i in 2:length(series))x[i] <- ((series[i] - series[i-1])/series[i-1])*100 | |
return(x) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Augmented Dickey-Fuller Test | |
data: Full sample | |
Dickey-Fuller = -2.4901, Lag order = 4, p-value = 0.3734 | |
alternative hypothesis: stationary | |
Augmented Dickey-Fuller Test | |
data: First 80 obs | |
Dickey-Fuller = -2.9479, Lag order = 4, p-value = 0.1882 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Reading the relevent files | |
install.packages("zoo") | |
library(zoo) | |
ife <- read.csv("CPI_Data.csv") | |
ife_wpi <- read.csv("WPI_Data_1.csv") | |
# Function to compute Y-o-Y inflation rate |
OlderNewer