library(tseries)
library(zoom)
library(zoo)
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library(moments)
library(ggplot2)
library(fBasics)
## Loading required package: timeDate
##
## Attaching package: 'timeDate'
## The following objects are masked from 'package:moments':
##
## kurtosis, skewness
## Loading required package: timeSeries
##
## Attaching package: 'timeSeries'
## The following object is masked from 'package:zoo':
##
## time<-
data <- read.csv("C:\\Users\\t420\\Desktop\\lauda.csv")
str(data)
## 'data.frame': 172 obs. of 3 variables:
## $ ly : num -0.001027 -0.003155 -0.000281 0.000808 0.003094 ...
## $ lu : num 8.4 8.92 8.57 8.34 7.87 ...
## $ lpi: num 1.49 1.49 1.5 1.51 1.51 ...
pi <- data[,3]
summary(pi)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.486 1.761 1.885 1.853 1.986 2.058
pi1 <- ts(pi)
par(mfcol=c(2,1))
plot(pi)
plot(pi1)

acf(pi, lag=12)

pacf(pi,lag=12)

sd(pi)
## [1] 0.152973
mean(pi)
## [1] 1.853205
range(pi)
## [1] 1.485736 2.057936
skewness(pi)
## [1] -0.7091381
## attr(,"method")
## [1] "moment"
kurtosis(pi)
## [1] -0.4013097
## attr(,"method")
## [1] "excess"
qplot(pi,geom= 'histogram', binwidth=20)+ xlab('Time')

s1 <- skewness(pi)
t1<-s1/sqrt(3/173)
t1
## [1] -5.385094
## attr(,"method")
## [1] "moment"
pv <- 2*(1-pnorm(t1))
pv
## [1] 2
## attr(,"method")
## [1] "moment"
lpi <- log(pi+1)*100
t.test(lpi)
##
## One Sample t-test
##
## data: lpi
## t = 250.54, df = 171, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 103.8723 105.5221
## sample estimates:
## mean of x
## 104.6972
The result shows that we fail to reject null hypothesis. That means true mean is zero.
normalTest(lpi, method='jb')
##
## Title:
## Jarque - Bera Normalality Test
##
## Test Results:
## STATISTIC:
## X-squared: 19.0228
## P VALUE:
## Asymptotic p Value: 7.4e-05
##
## Description:
## Wed Mar 28 19:56:03 2018 by user: t420
The result shows the normality for inflation is rejected.