-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rhistory
157 lines (157 loc) · 4.53 KB
/
.Rhistory
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
remotes::install_github("anthonynorth/rscodeio")
install.packages("remotes")
remotes::install_github("anthonynorth/rscodeio")
rscodeio::install_theme()
rscodeio::install_theme()
install.packages("remotes")
remotes::install_github("anthonynorth/rscodeio")
rscodeio::install_theme()
rscodeio::install_theme()
rscodeio::install_theme()
install.packages("remotes")
remotes::install_github("anthonynorth/rscodeio")
install.packages("remotes", force=T)
install.packages("remotes", force = T)
remotes::install_github("anthonynorth/rscodeio")
remotes::install_github("anthonynorth/rscodeio", force=T)
rscodeio::install_theme()
install.packages("tidyverse")
rscodeio::activate_menu_theme
rscodeio::activate_menu_theme()
rscodeio::uninstall_theme()
# libs
library(fpp)
library(stats)
library(xts)
library(ggplot2)
library(forecast)
# load data
df <- read.csv("./dataset.csv")
library(fpp)
library(stats)
library(xts)
library(ggplot2)
library(forecast)
##https://rpubs.com/Linh-LTP/648937
# load data
df <- read.csv("./Toplamsal_Ayristirma/dataset.csv")
getwd()
setwd('./Github/R-ile-Zaman-Serileri-Analizi/')
##https://rpubs.com/Linh-LTP/648937
# load data
df <- read.csv("./Toplamsal_Ayristirma/dataset.csv")
names(df) <- c("date", "electric")
# tarih-saat belirleme
df[,1] <- as.POSIXct(df[,1], format = "%Y-%m-%d %H:%M:%S")
df_xts <- as.xts(df[,-1], order.by = df[,1])
class(df_xts) ; head(df_xts)
#periyodu 18 olan zaman serisi
df_ts <- ts(df_xts[1:144], frequency = 18)
#zaman serisi grafiği
plot.ts(df_ts)
df_ts[is.nan(df_ts)] <- 0
#zaman serisi grafiği
plot.ts(df_ts)
df_ts[is.nan(df_ts)] <- 0
df_timeseriescomponents <- decompose(df_ts)
plot(df_timeseriescomponents)
plot(df_timeseriescomponents, lwd=3)
plot(df_timeseriescomponents, lwd=2)
plot(df_timeseriescomponents, lwd=2, lag=42)
Acf(df_timeseriescomponents)
df_timeseriescomponents
df_timeseriescomponents[is.nan(df_timeseriescomponents)] <- 0
df_timeseriescomponents <- decompose(df_ts)
df_timeseriescomponents[is.nan(df_timeseriescomponents)] <- 0
View(df_timeseriescomponents)
df_timeseriescomponents[is.nan(df_timeseriescomponents$trend)] <- 0
# tarih-saat belirleme
df[,1] <- as.POSIXct(df[,1], format = "%Y-%m-%d %H:%M:%S")
df_xts <- as.xts(df[,-1], order.by = df[,1])
class(df_xts) ; head(df_xts)
#periyodu 18 olan zaman serisi
df_ts <- ts(df_xts[1:144], frequency = 18)
#zaman serisi grafiği
plot.ts(df_ts)
df_ts[is.nan(df_ts)] <- 0
df_timeseriescomponents <- decompose(df_ts)
df_timeseriescomponents$trend[is.nan(df_timeseriescomponents$trend)] <- 0
df_timeseriescomponents
df_timeseriescomponents$trend
df_timeseriescomponents[is.nan(df_timeseriescomponents$trend)] <- 0
#zaman serisi grafiği
plot.ts(df_ts)
df_ts[is.nan(df_ts)] <- 0
df_timeseriescomponents <- decompose(df_ts)
df_timeseriescomponents[is.nan(trend)] <- 0
library(fpp)
library(stats)
library(xts)
library(ggplot2)
library(forecast)
##https://rpubs.com/Linh-LTP/648937
# load data
df <- read.csv("./Toplamsal_Ayristirma/dataset.csv")
names(df) <- c("date", "electric")
# tarih-saat belirleme
df[,1] <- as.POSIXct(df[,1], format = "%Y-%m-%d %H:%M:%S")
df_xts <- as.xts(df[,-1], order.by = df[,1])
class(df_xts) ; head(df_xts)
#periyodu 18 olan zaman serisi
df_ts <- ts(df_xts[1:144], frequency = 18)
#zaman serisi grafiği
plot.ts(df_ts)
df_ts[is.nan(df_ts)] <- 0
df_timeseriescomponents <- decompose(df_ts)
df_timeseriescomponents <- decompose(df_ts)
df_timeseriescomponents[is.nan(df_timeseriescomponents$trend)] <- 0
plot(df_timeseriescomponents, lwd=2, lag=42)
Acf(df_timeseriescomponents)
df_timeseriescomponents <- decompose(df_ts)
plot(df_timeseriescomponents, lwd=2, lag=42)
Acf(df_timeseriescomponents)
Acf(df_timeseriescomponents$trend)
install.packages("ets")
library(ets)
winters <- ets(df_ts, model = "AAA")
ets(df_ts, model = "AAA")
summary(winters)
winters1 <- ets(df_ts, model = "AAA")
winters1
summary(winters1)
winters2 <- ets(df_ts, model = "MAM")
winters1 <- ets(df_ts, model = "AAA")
df_ts
View(df_ts)
df_ts["Series 1"]
df_ts[, 1]
df_ts[, 1][df[, 1] == 0] <- NA
library(dplyr)
na_if(df_ts, 0)
winters2 <- ets(df_ts, model = "MAM")
#periyodu 18 olan zaman serisi
df_ts <- ts(df_xts[1:144], frequency = 18)
df_ts +1
winters2 <- ets(df_ts +1, model = "MAM")
w
winters2
winters2 <- ets(df_ts +1, model = "MAM")
winters2
winters2 <- ets(df_ts +1, model = "MAM")
summary(winters2)
df_ts
df_ts + 1
winters2 <- ets(df_ts +0.5, model = "MAM")
summary(winters2)
winters2 <- ets(df_ts +0.0005, model = "MAM")
summary(winters2)
View(winters1)
plot(winters1)
plot(winters1.fitted)
plot(winters1$fitted)
plot(winters1$residuals)
?ets
winters1.states
winters1$states
ts.plot(winters1)
plot(winters1)