-
Notifications
You must be signed in to change notification settings - Fork 1
/
Table_01_Summary_Statistics_BRIC_FEWNet.R
144 lines (121 loc) · 5.27 KB
/
Table_01_Summary_Statistics_BRIC_FEWNet.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
################### Table 01: Sumary Statistics - BRIC ###############
set.seed(20240101) # For reproducibility, we are using this seed value
# Load the necessary libraries
library(nonlinearTseries)
library(tseries)
library(forecast)
library(Metrics)
library(ggplot2)
library(readr)
library(WaveletArima)
library(caret)
library(nnfor)
library(tsDyn)
library(fracdiff)
library(bsts)
library(forecastHybrid)
library(e1071)
library(tseriesChaos)
library(pracma)
library(Kendall)
library(GeneCycle)
library(fpp2)
library(seastests)
library(entropy)
library(zoo)
library(sandwich)
library(strucchange)
library(tseries)
################## Brazil ############################
# Set the working directory
setwd("/FEWNet/dataset/brazil")
getwd()
# Data
cpi.df <- read.csv("Brazil_CPI_inf_rate_Monthly_base_mulvar_cpi_epu_gprc_202201.csv",header=TRUE)
# Observations: Output for Obs. in Table 01
str(cpi.df) # Obs.: 227 for CPI Inflation, log(EPU) and GPRC Series
# Find the Min-value, Max Value, Mean Value, Median Value, Q1-value, Q3-value
# Min. Values
sapply(cpi.df[-1], function(x) min(x)) # reported values are rounded off to 2-decimal points
# Max. Values
sapply(cpi.df[-1], function(x) max(x)) # reported values are rounded off to 2-decimal points
# Q1 (25%) and Q3 (75%) Values
sapply(cpi.df[-1], function(x) quantile(x, prob=c(.25,.5,.75), type=1)) # reported values are rounded off to 2-decimal points
# Mean Values
sapply(cpi.df[-1], function(x) mean(x)) # reported values are rounded off to 2-decimal points
#Median Values
sapply(cpi.df[-1], function(x) median(x)) # reported values are rounded off to 2-decimal points
# Calculating the Coefficient of Variations for the 3 series
sapply(cpi.df[-1], function(x) sd(x) / mean(x) * 100)
# Calculating the Entropy for the 3 series
sapply(cpi.df[-1], function(x) entropy(x, method="MM"))
################## Russia ############################
# Set the working directory
setwd("/FEWNet/dataset/russia")
getwd()
# Data
cpi.df <- read.csv("RUS_CPI_inf_rate_Monthly_mulvar_epu_gprc_202201.csv",header=TRUE)
# Observations: Output for Obs. in Table 01
str(cpi.df)
# Find the Min-value, Max Value, Mean Value, Median Value, Q1-value, Q3-value
# Min. Values
sapply(cpi.df[-1], function(x) min(x)) # reported values are rounded off to 2-decimal points
# Max. Values
sapply(cpi.df[-1], function(x) max(x)) # reported values are rounded off to 2-decimal points
# Q1 (25%) and Q3 (75%) Values
sapply(cpi.df[-1], function(x) quantile(x, prob=c(.25,.5,.75), type=1)) # reported values are rounded off to 2-decimal points
# Mean Values
sapply(cpi.df[-1], function(x) mean(x)) # reported values are rounded off to 2-decimal points
#Median Values
sapply(cpi.df[-1], function(x) median(x)) # reported values are rounded off to 2-decimal points
# Calculating the Coefficient of Variations for the 3 series
sapply(cpi.df[-1], function(x) sd(x) / mean(x) * 100)
# Calculating the Entropy for the 3 series
sapply(cpi.df[-1], function(x) entropy(x, method="MM"))
################## India ############################
# Set the working directory
setwd("/FEWNet/dataset/india")
getwd()
# Data
cpi.df <- read.csv("India_CPI_inf_rate_Monthly_base_mulvar_cpi_epu_gprc_202201.csv",header=TRUE)
# Observations: Output for Obs. in Table 01
str(cpi.df)
# Find the Min-value, Max Value, Mean Value, Median Value, Q1-value, Q3-value
# Min. Values
sapply(cpi.df[-1], function(x) min(x)) # reported values are rounded off to 2-decimal points
# Max. Values
sapply(cpi.df[-1], function(x) max(x)) # reported values are rounded off to 2-decimal points
# Q1 (25%) and Q3 (75%) Values
sapply(cpi.df[-1], function(x) quantile(x, prob=c(.25,.5,.75), type=1)) # reported values are rounded off to 2-decimal points
# Mean Values
sapply(cpi.df[-1], function(x) mean(x)) # reported values are rounded off to 2-decimal points
#Median Values
sapply(cpi.df[-1], function(x) median(x)) # reported values are rounded off to 2-decimal points
# Calculating the Coefficient of Variations for the 3 series
sapply(cpi.df[-1], function(x) sd(x) / mean(x) * 100)
# Calculating the Entropy for the 3 series
sapply(cpi.df[-1], function(x) entropy(x, method="MM"))
################## China ############################
# Set the working directory
setwd("/FEWNet/dataset/china")
getwd()
# Data
cpi.df <- read.csv("China_CPI_inf_rate_Monthly_mulvariate_epu_gprc_202201.csv",header=TRUE)
# Observations: Output for Obs. in Table 01
str(cpi.df)
# Find the Min-value, Max Value, Mean Value, Median Value, Q1-value, Q3-value
# Min. Values
sapply(cpi.df[-1], function(x) min(x)) # reported values are rounded off to 2-decimal points
# Max. Values
sapply(cpi.df[-1], function(x) max(x)) # reported values are rounded off to 2-decimal points
# Q1 (25%) and Q3 (75%) Values
sapply(cpi.df[-1], function(x) quantile(x, prob=c(.25,.5,.75), type=1)) # reported values are rounded off to 2-decimal points
# Mean Values
sapply(cpi.df[-1], function(x) mean(x)) # reported values are rounded off to 2-decimal points
#Median Values
sapply(cpi.df[-1], function(x) median(x)) # reported values are rounded off to 2-decimal points
# Calculating the Coefficient of Variations for the 3 series
sapply(cpi.df[-1], function(x) sd(x) / mean(x) * 100)
# Calculating the Entropy for the 3 series
sapply(cpi.df[-1], function(x) entropy(x, method="MM"))
################## End Of Code ############################