-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path-MSI.Rhistory
512 lines (512 loc) · 20.4 KB
/
-MSI.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
theme(
axis.text.x = element_text(size=6,angle=45),
strip.text.x = element_text(size = 10)) + facet_wrap(~name,ncol=9) +
labs(title='Fastest Lap distribution per Circuit',
subtitle='speed in km/h, grouped by years') +
guides(color=FALSE)
```
##Are F1 Circuits shorter now ?
By looking at the average lap time, we can infer this question. As for the `fastestLapSpeed`, it also depends on other factors(car getting better/ faster ?) but I think primarily the `fastestLapTime` can reflect on how long a circuit is.
```{r fig.width=10, fig.height=5, fig.align='center'}
results_2 %>%
dplyr::filter(year>2004) %>%
dplyr::group_by(name,year) %>%
summarize(medianFastestLapTimeNum = median(fastestLapTimeNum,na.rm=T)) %>%
ggplot(aes(x=factor(year),y= medianFastestLapTimeNum, color=medianFastestLapTimeNum)) +
geom_boxplot(alpha=.25) + theme_fivethirtyeight() +
geom_jitter(shape=16,position=position_jitter(0.2),size=1.5) +
geom_smooth(method='loess',aes(group=1),color='red',lty=2,size=.5) +
scale_color_gradientn(name="",colours=rev(viridis::viridis(20))) +
labs(title='Lap time per Year',
subtitle='in seconds, grouped by Grand Prix') +
guides(color = FALSE)
```
* it looks like there was some trend, with an increase in the time to complete a single lap.
* then from 2014 and onwards, it looks like to plateau a bit.
```{r fig.width=10, fig.height=5, fig.align='center'}
results_2 %>%
dplyr::filter(year>2004) %>%
dplyr::group_by(name,year) %>%
summarize(medianFastestLapTimeNum = median(fastestLapTimeNum,na.rm=T)) %>%
ggplot(aes(x=factor(year),y= medianFastestLapTimeNum, color=medianFastestLapTimeNum)) +
geom_point() + theme_fivethirtyeight() +
scale_color_gradientn(name="",colours=rev(viridis::viridis(20))) +
theme(
axis.text.x = element_text(size=6,angle=45),
strip.text.x = element_text(size = 10)) + facet_wrap(~name,ncol=9) +
labs(title='Lap time per Year, from 2005 to 2017',
subtitle='in seconds') +
guides(color=FALSE)
```
#`Drivers` dataset
Here:
* I joined the `drivers` datasets
* calculate the current driver's age
* joined the result with the main file(`results`) and `races`
It should give a pretty complete dataframe at this point.
```{r}
drivers<-read.csv('../input/drivers.csv',sep=',',stringsAsFactors=F)
#calculate the driver's age in 2017
drivers$age_driver <- 2017 - sapply(drivers$dob, function(x) as.numeric(strsplit(x,'/')[[1]][3]))
#load driversStandings
driversStandings<-read.csv('../input/driverStandings.csv',sep=',',stringsAsFactors=F)
drivers<-left_join(drivers %>% select(-url), driversStandings,by='driverId')
#results_3<-
# left_join(
# results,
# drivers %>% dplyr::rename(number_drivers = number) %>% select(-points, -position, -positionText),
# by=c('driverId','raceId')) %>%
# left_join(races %>% select(-time), by='raceId')
results_3<-left_join(
results,
drivers %>% dplyr::rename(number_drivers = number) %>% select(-points, -position, -positionText),
by=c('driverId','raceId'))
results_3<-left_join(results_3,races %>% select(-time), by='raceId')
```
```{r fig.width=10, fig.height=10, fig.align='center',eval=T}
winsDis<-results_3 %>%
filter(position==1) %>%
group_by(driverRef, circuitRef) %>%
summarize(count=n()) %>%
mutate(allWins = sum(count)) %>%
ggplot(aes(x=allWins)) +
geom_histogram(bins=50) + theme_fivethirtyeight() + ggtitle("Distribution of the number of victories")
winsBar<-results_3 %>%
dplyr::filter(position==1) %>%
dplyr::group_by(driverRef, circuitRef) %>%
dplyr::summarize(count=n()) %>%
dplyr::mutate(allWins = sum(count)) %>%
dplyr::filter(allWins>2) %>%
ggplot(aes(x=reorder(driverRef, allWins),y= count)) +
geom_bar(aes(fill=circuitRef),stat='identity',color='white',size=.1) +
coord_flip() + theme_fivethirtyeight() +
scale_fill_manual(name="",values = viridis::viridis(71)) +
guides(fill=guide_legend(ncol=5)) +
theme(legend.text= element_text(size=10),
legend.key.size = unit(.1, "cm"),
legend.position=c(.65,.20)) +
labs(title="Number of victories per Driver",
subtitle="only drivers with 2 or more wins are shown.")
```
```{r eval=T}
winsBar + annotation_custom(grob = ggplotGrob(winsDis), xmin = 22, xmax = 50, ymin = 31, ymax = 90)
#winsBar + annotation_custom(grob = ggplotGrob(winsDis), xmin = 30, xmax = 30, ymin = 29, ymax = 95)
```
#Constructors
* merge all 3 `constructors` datafiles.
```{r}
constructors<-read.csv('../input/constructors.csv',sep=',',stringsAsFactors=F)
constructorStandings<-read.csv('../input/constructorStandings.csv',sep=',',stringsAsFactors=F)
constructorResults<-read.csv("../input/constructorResults.csv",sep=",",stringsAsFactors=F)
constructorResults<-left_join(
constructorResults,
races %>% rename(name_races = name), by='raceId')
constructorResults <- left_join(constructorResults, constructors %>% select(-url) %>% rename(name_constructor = name), by='constructorId')
constructorResults <- left_join(constructorResults, constructorStandings %>% rename(point_constructor = points) %>% select(-X), by=c('constructorId','raceId'))
```
```{r fig.width=10, fig.height=6, fig.align='center'}
winConstructors<-constructorResults %>%
filter(wins == 1) %>%
group_by(name_constructor) %>%
summarize(count=n()) %>%
filter(count>0) %>%
ggplot(aes(x=reorder(name_constructor, count),y= count,fill=count)) +
geom_bar(stat='identity',color='white',size=.1) +
coord_flip() + theme_fivethirtyeight() +
scale_fill_gradientn(name="",colors = viridis::viridis(10)) +
guides(fill=guide_legend(ncol=3)) +
theme(legend.text= element_text(size=10),
legend.key.size = unit(.1, "cm"),
legend.position=c(.65,.20)) +
labs(title="Number of victories per Constructor",
subtitle="only Constructor with 1 or more wins are shown.") + guides(fill=F)
top5Constructors<-constructorResults %>%
filter(name_constructor %in% c('Ferrari','McLaren','Williams','Brabham','BRM')) %>%
filter(wins == 1) %>% group_by(name_constructor,year) %>%
summarize(count=n()) %>%
ggplot(aes(x=factor(year),y=count)) +
geom_histogram(aes(fill=name_constructor),
stat='identity',
position="fill",
size=1.5) +
theme_fivethirtyeight() + scale_fill_brewer(name="",palette='Paired') +
theme(axis.text.x = element_text(size=8,angle=45)) + ggtitle("Top 5 constructors's wins per year")
```
```{r fig.width=10, fig.height=8, fig.align='center'}
winConstructors +
annotation_custom(grob = ggplotGrob(top5Constructors), xmin = 20, xmax = 0, ymin = 20, ymax = 200)
```
#PROST - SENNA : the greatest rivalry
* filter the results for `Prost`, `Senna` only
* before 1991, a victory accounted for 9 points so that's how I found whether there was a win or not.
```{r}
y1988 <- results_3 %>%
dplyr::filter(driverRef=='prost' | driverRef=='senna')%>%
filter(year==1988) %>%
select(date,driverRef,points) %>% mutate(winRace = ifelse(points==9,'yes','no')) %>%
group_by(driverRef) %>%
mutate(current = cumsum(points)) %>%
ggplot(aes(x=date,y=current,color=driverRef)) +
geom_line(size=2,alpha=.5) + geom_point(aes(shape=winRace),color='black',size=2) +
theme_fivethirtyeight() + scale_color_brewer(name="",palette='Set1') + ylim(0,120) +
labs(title="Points accumulated during Season 1988",subtitle = 'triangle indicates a race win, circle otherwise') +
theme(legend.position='right',legend.direction='vertical') + guides(shape=FALSE)
y1989<-results_3 %>%
dplyr::filter(driverRef=='prost' | driverRef=='senna') %>%
filter(year==1989) %>%
select(date,driverRef,points) %>% mutate(winRace = ifelse(points==9,'yes','no')) %>%
group_by(driverRef) %>%
mutate(current = cumsum(points)) %>%
ggplot(aes(x=date,y=current,color=driverRef)) +
geom_line(size=2,alpha=.5) + geom_point(aes(shape=winRace),color='black',size=2) +
theme_fivethirtyeight() + scale_color_brewer(name="",palette='Set1') +
labs(title="Points accumulated during Season 1989",subtitle = 'triangle indicates a race win, circle otherwise\n[1]:https://www.motorsport.com/f1/news/25-years-ago-today-a-rivalry-became-legendary-1989-japanese-gp/') +
theme(legend.position='right',legend.direction='vertical') + guides(shape=FALSE) +
annotate("text", x=as.Date("1989-10-15"), y = 68, label = "The Japanese incident[1]", size=3, colour="black") +
geom_curve(aes(x = as.Date("1989-10-15"), y = 71, xend = as.Date("1989-10-22"), yend = 79), curvature = .05,arrow = arrow(length = unit(0.02, "npc")),color='black')
```
```{r fig.width=10, fig.height=8, fig.align='center'}
grid.arrange(y1988, y1989, ncol=1)
```
* Prost outscored Senna in both seasons.
* In 1988, only the best 11 results counted toward the championship([Peter Higham, The Guinness Guide to International Motor Racing, 1995, page 126](https://www.bullpublishing.com/shop/item.asp?itemid=4))
* Prost scored 105 points during the year, but only 87 points were counted toward the championship. Senna scored 94 points, with 90 points counted toward the championship by virtue of winning more races.
* Thus, Senna became the World Champion, although he did not score the most points over the course of the year.
* in 1989, the _Japanese incident_ refers to the Suzuka Grand Prix: Senna had to win to secure the championship, whereas Prost’s only chance to win the championship hinged on Senna not finishing the race.
* When the race began Prost took the lead early on, but on lap 46 at the Casino chicane, both drivers collided and ran off the track([reference](https://www.sportskeeda.com/f1/ayrton-senna-and-alain-prosts-legendary-rivalry-and-the-politics-behind-it))
# The _Red Baron_ case: is Michael Schumacher the greatest driver of all time ?
* Basically I need to merge a lot of files
```{r}
results_4<-
left_join(
results %>% select(-time) %>% rename(number_results = number),
drivers %>% select(-points,-position,-positionText) %>% rename(number_drivers = number, driver_nationality = nationality),by=c('driverId','raceId')) %>%
left_join(constructorResults %>% select(-points, -position, -positionText, -X) %>% rename(wins_constructor = wins, nationality_constructor = nationality), by=c('raceId','constructorId'))
```
```{r}
#races by (year, constructor)
g1<-results_4 %>% filter(driverRef == 'michael_schumacher') %>%
group_by(name_constructor, year) %>% summarize(countByConstructor = n()) %>%
ggplot(aes(x=factor(year),y=countByConstructor,fill=name_constructor)) +
geom_histogram(stat='identity') + theme_fivethirtyeight() +
scale_fill_manual(name='',values =c(Benetton='#87CEEB',Ferrari='#EE0000',Jordan='#FFD700',Mercedes='#7F7F7F')) +
theme(legend.position='top',
axis.ticks=element_blank(),
axis.text.x=element_blank(),
axis.title.x=element_blank()) +
labs(title='The Red baron case : Michael Schumacher',subtitle='top : by constructor, bottom : cumulated')
g2<-results_4 %>% filter(driverRef == 'michael_schumacher') %>%
group_by(year) %>% summarize(count=n()) %>% mutate(cumulRaces = cumsum(count)) %>%
ggplot(aes(x=factor(year),y=cumulRaces))+ geom_histogram(stat='identity') +
theme_fivethirtyeight() + theme(legend.position='None')
```
```{r fig.width=10, fig.height=8, fig.align='center'}
grid.arrange(g1, g2, ncol=1, nrow=2, heights=c(4, 1))
```
* short answer : YES! (more than 300 races in 19 F1 seasons)
* also he stayed more than 10 years at Ferrari.
#50 years of F1, 10 best drivers
* question : did some drivers dominate the Championship during their active years ?
```{r}
#find the top 10 drivers, by their number of wins
temp<-(results_3 %>% filter(position==1) %>% group_by(driverRef) %>% summarize(count=n()) %>% arrange(-count) %>% top_n(10))$driverRef
results_3$top10<-ifelse(results_3$driverRef %in% temp,results_3$driverRef,'other')
```
```{r fig.width=10, fig.height=6, fig.align='center'}
results_3 %>% filter(position==1) %>% group_by(top10,year) %>%
summarize(count=n()) %>% filter(count>0 & year>=1960) %>%
ggplot(aes(x=factor(year),y=count)) +
geom_histogram(aes(fill=top10),position="fill",stat='identity') +
theme_fivethirtyeight() +
theme(legend.position='bottom',
axis.text.x = element_text(size=8,angle=45)) +
scale_fill_brewer(name="",palette='Paired') + guides(fill=guide_legend(ncol=13)) +
labs(title='Proportion of wins per Driver and year',
subtitle='only the top 10 drivers by number of wins are shown')
```
* during the `60's`, `70's` --> hegemony of __Jim Clark__ and __Jackie Stewart__
* end of `70's` --> hegemony of __Niki Lauda__
* `80's` to early `90's` --> __Nigel Mansell__, __Alain Prost__ and __Ayrton Senna__
* the __Red Baron__ dominates all the `90's` and beginning of `2000`
* then recently --> __Fernando Alonso__, __Leweis Hamilton__ and __Sebastian Vettel__
#Relationship `Driver`, `Constructor`
A chordiagram is useful to show relationship between 2 entities. In the following section, I :
* join the `results` and `constructor` dataset
* select when a win occured (`position==1`)
* group_by (`constructor`, `driver`)
* filter by the number of wins (for visibility)
* assign some color code to some `Constructor`
```{r}
results_4<-left_join(
results_3,
constructorResults %>% select(-position,-positionText,-points,-X,-country,-wins,-lng,-lat,-alt,-nationality,-circuitRef,-round, -circuitId,-year,-time,-date,-location),
by=c('raceId','constructorId'))
temp<-data.frame(
results_4 %>% filter(position==1) %>%
group_by(name_constructor, driverRef) %>%
summarize(count=n()) %>% filter(count>5) %>% na.omit())
#prepare colors
names<-sort(unique(temp$name_constructor))
color <- c('#87CEEB',"gray50","gray50","#FFFFE0","gray50","#006400",'#EE0000','#1E90FF','gray50','#006400','#7F7F7F','#7F7F7F','#9C661F','#FFD700','gray50','gray50','#EEEEE0')
COL<-data.frame(name_constructor = names,color)
temp2<-data.frame(left_join(temp, COL, by='name_constructor'))
```
```{r fig.width=10, fig.height=10, fig.align='center'}
chordDiagram(temp2[,c(1:2)],transparency = 0.5, grid.col = append(color,rep('aliceblue',32)), col= as.character(temp2$color),annotationTrack = "grid", preAllocateTracks = 1)
#cosmetic
circos.trackPlotRegion(
track.index = 1,
panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
circos.text(
mean(xlim),
ylim[1],
sector.name,
facing = "clockwise",
niceFacing = TRUE,
adj = c(0, 0.25),
cex=.7)
circos.axis(
h = "top",
labels.cex = 0.5,
major.tick.percentage = 0.2,
sector.index = sector.name,
track.index = 2)
},
bg.border = NA)
```
* `McLaren`, `Ferrari` and `Williams` dominate.
<hr>
<strong>History :</strong>
* _version 1 : initial commit_
* _version 2 : better coding(pipes, joins), added constructors and drivers section_
* _version 3 : added M. Schumacher plots_
* _version 4 : added top10 drivers plot_
* _verison 5 : added chordiagramm for driver/constructor relationship_
<hr>
library(ggplot2)
library(dplyr)
library(gridExtra)
library(ggthemes)
library(RColorBrewer)
library(grid)
library(gridExtra)
library(ggrepel)
library(viridis)
library(circlize)
start(q_ite)
end(q_ite)
frequency(q_ite)
plot(diff(log(q_ite)))
plot(diff(q_ite))
plot(log(q_ite))
plot(q_ite)
acf(q_ite)
plot(diff(diff(q_ite)))
plot(diff(diff(diff(q_ite))))
plot(diff(diff(diff(diff(q_ite)))))
plot(diff(diff(diff(diff(diff(q_ite))))))
View(mydata.cor)
View(p)
plot(diff(diff(log(q_ite))))
plot(q_ite)
stl(q_ite)
acf(q_ite)
#ARIMA
pacf(q_ite)
acf(diff(log(q_ite)))
pacf(diff(log(q_ite)))
fit <- arima(log(q_ite), c(-1, 1, 0), seasonal = list(order=c(-1,1,0), period = 1))
fit <- arima(log(q_ite), c(0, 1, 0), seasonal = list(order=c(0,1,0), period = 1))
pred1 <- 2.718^pred$pred
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
pred1
plot(pred1)
ts.plot(q_ite, 2.718^pred$pred, log='y')
ts.plot(q_ite, 2.718^pred$pred, log='y', lty=c(1,3))
pred
q_ite
plot(ite)
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
start(q_ite)
acf(q_ite)
#ARIMA
pacf(q_ite)
acf(diff(log(q_ite)))
pacf(diff(log(q_ite)))
r_sop<-ts(q$sop, start=2009, end=2019, frequency=1)
r_sos<-ts(q$sos, start=2009, end=2019, frequency=1)
r_tr<-ts(q$tr, start=2009, end=2019, frequency=1)
r_cop<-ts(q$cop, start=2009, end=2019, frequency=1)
r_cos<-ts(q$cos, start=2009, end=2019, frequency=1)
r_bcie<-ts(q$bcie, start=2009, end=2019, frequency=1)
r_tcae<-ts(q$tcae, start=2009, end=2019, frequency=1)
r_ifoi<-ts(q$ifoi, start=2009, end=2019, frequency=1)
r_gaae<-ts(q$sop, start=2009, end=2019, frequency=1)
r_rade<-ts(q$gaae, start=2009, end=2019, frequency=1)
r_glod<-ts(q$glod, start=2009, end=2019, frequency=1)
r_efo<-ts(q$efo, start=2009, end=2019, frequency=1)
r_oi<-ts(q$oi, start=2009, end=2019, frequency=1)
r_iade<-ts(q$iade, start=2009, end=2019, frequency=1)
r_ebit<-ts(q$ebit, start=2009, end=2019, frequency=1)
r_ite<-ts(q$ite, start=2009, end=2019, frequency=1)
r_ne<-ts(q$ne, start=2009, end=2019, frequency=1)
r_beps<-ts(q$beps, start=2009, end=2019, frequency=1)
r_deps<-ts(q$deps, start=2009, end=2019, frequency=1)
acf(q_ite)
#ARIMA
pacf(q_ite)
fit <- arima(log(q_ite), c(1, 0, 0), seasonal = list(order=c(0,1,0), period = 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
pred1
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
plot(pred1)
ts.plot(q_ite, 2.718^pred$pred)
acf(diff(q_ite))
pacf(diff(q_ite))
fit <- arima(log(q_ite), c(1, 0, 1), seasonal = list(order=c(0,1,0), period = 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
acf(diff(diff(q_ite)))
pacf(diff(diff(q_ite)))
fit <- arima(log(q_ite), c(1, 2, 0), seasonal = list(order=c(0,1,0), period = 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
fit <- arima(log(q_ite), c(1, 2, 0), seasonal = list(order=c(1, 2, 0), period = 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
fit <- arima(log(q_ite), c(1, 2, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
fit <- arima(diff(q_ite), c(1, 1, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
acf(q_ite)
#ARIMA
pacf(q_ite)
fit <- arima((q_ite), c(1, 0, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
pred
plot(pred1)
plot(pred)
fit <- arima(diff(q_ite), c(1, 0, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(0, 1, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(0, 1, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(1, 0, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(0, 0, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(1, 1, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(log(q_ite), c(1, 2, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(diff(q_ite), c(1, 1, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
plot(pred1)
fit <- ar(q_ite, c(1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
plot(pred1)
fit <- ar(q_ite, c(1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
plot(pred)
ts.plot(q_ite, 2.718^pred$pred)
adf.test(q_ite)
autoplot(q_ite)
acf(q_ite)
pacf(q_ite)
fit <- arima(q_ite, c(1, 4, 0))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(q_ite, c(0, 0, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(q_ite, c(0, 1, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(q_ite, c(0, 2, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(q_ite, c(0, 3, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit <- arima(q_ite, c(0, 4, 1))
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
fit<-auto.arima(q_ite)
library(forecast)
install.packages(forecast)
install.packages("forecast")
library(forecast)
fit<-auto.arima(q_ite)
pred <- predict(fit, n.ahead = 10)
pred1 <- 2.718^pred$pred
ts.plot(q_ite, 2.718^pred$pred)
pred1
pred
ts.plot(q_ite, pred$pred)
fit<-auto.arima(q_ite)
pred <- predict(fit, n.ahead = 10)
pred
fit<-auto.arima(q_ite, c(0,1))
fit <- arma(q_ite, c(0, 1))
fit<-auto.arima(q_oi),
fit <- arma(q_ite, c(0, 1))
fit<-auto.arima(q_oi)
pred <- predict(fit, n.ahead = 10)
ts.plot(q_ite, pred$pred)
pred
ts.plot(q_ite, pred$se)
fit<-auto.arima(q_efo)
pred <- predict(fit, n.ahead = 10)
ts.plot(q_ite, pred$se)
fit<-auto.arima(q_efo)
pred <- predict(fit, n.ahead = 10)
ts.plot(q_efo, pred$se)