-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
512 lines (512 loc) · 22.5 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
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
gas$midgrade %>% tbats() %>% forecast(h = 1)
gas$premium %>% tbats() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663),
premium = c(697, 661, 641, 554, 537, 509, 512, 554)
)
gas$regular %>% tbats() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
View(gas)
gas$regular %>% auto.arima() %>% forecast(h = 6)
gas$midgrade %>% auto.arima() %>% forecast(h = 6)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589)
)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "apr"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589)
)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589)
)
gas$regular %>% auto.arima() %>% forecast(h = 6)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr", "may","jun"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr", "may","jun", "jul"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% tbats() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% ets() %>% forecast(h = 1)
gas$midgrade %>% ets() %>% forecast(h = 1)
gas$premium %>% ets() %>% forecast(h = 1)
gas$regular %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr", "may","jun", "jul", "aug"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr", "may","jun", "jul", "aug", "sep", "oct"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
month = c("jul", "aug", "sep", "oct", "nov", "dec", "jan", "feb", "mar", "apr", "may","jun", "jul", "aug", "sep", "oct", "nov"),
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% auto.arima() %>% forecast(h = 1) %>% autoplot()
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499, 12093),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344, 2267),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781, 756)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499, 12093, 10814),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344, 2267, 2028),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781, 756, 676)
)
gas$regular %>% auto.arima() %>% forecast(h = 1)
gas$midgrade %>% auto.arima() %>% forecast(h = 1)
gas$premium %>% auto.arima() %>% forecast(h = 1)
gas$regular %>% ets() %>% forecast(h = 1)
gas$regular %>% ets() %>% forecast(h = 1)
gas$midgrade %>% ets() %>% forecast(h = 1)
gas$premium %>% ets() %>% forecast(h = 1)
gas$regular %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$midgrade %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$premium %>% ets() %>% forecast(h = 1) %>% autoplot()
gas$regular %>% ets() %>% forecast(h = 1)
gas$midgrade %>% ets() %>% forecast(h = 1)
gas$premium %>% ets() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499, 12093, 10814, 10688, 9855),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344, 2267, 2028, 1848),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781, 756, 676, 616)
)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499, 12093, 10814, 10688, 9855),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344, 2267, 2028, 2004, 1848),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781, 756, 676, 668, 616)
)
gas$regular %>% ets() %>% forecast(h = 1)
gas$midgrade %>% ets() %>% forecast(h = 1)
gas$premium %>% ets() %>% forecast(h = 1)
gas <- data.frame(
regular = c(11158, 10571, 10258, 8863, 8593, 8151, 8198, 8872, 9431, 10039, 10884, 10775, 11124, 10598, 10069, 9275, 8709, 8411, 9448, 10001, 10482, 10950, 11424, 12499, 12093, 10814, 10688, 9855, 9778),
midgrade = c(2092, 1982, 1923, 1662, 1611, 1528, 1537, 1663, 1768, 1882, 2041, 2020, 2086, 1987, 1888, 1739, 1633, 1577, 1771, 1875, 1965, 2053, 2142, 2344, 2267, 2028, 2004, 1848, 1833),
premium = c(697, 661, 641, 554, 537, 509, 512, 554, 589, 627, 680, 673, 695, 662, 629, 580, 544, 526, 590, 625, 655, 684, 714, 781, 756, 676, 668, 616, 611)
)
gas$regular %>% ets() %>% forecast(h = 1)
gas$midgrade %>% ets() %>% forecast(h = 1)
gas$premium %>% ets() %>% forecast(h = 1)
remotes::install_github("ColumbusCollaboratory/photon")
install.packages("remotes")
remotes::install_github("ColumbusCollaboratory/photon")
photon::photon_rstudioaddin()
library(photon)
photon::photon_rstudioaddin()
l <- 6
8*l
l^2
(8l * 26) + 5l^2 - (1/3)l^2
((8l)(26)) + 5l^2 - (1/3)l^2
((8*6)(26)) + 5l^2 - (1/3)l^2
((8*6))*26) + 5l^2 - (1/3)l^2
((8*6)*26) + 5l^2 - (1/3)l^2
8l*26
l <- 6
8l*26
8l
8*l
((8*l)*26) + 5l^2 - (1/3)l^2
((8*l)*26) + 5*l^2 - (1/3)*l^2
l <- 10
((8*l)*26) + 5*l^2 - (1/3)*l^2
((8*l)*30) + 5*l^2 - (1/3)*l^3
l <- 6
((8*l)*30) + 5*l^2 - (1/3)*l^3
k <- 20
l <- 15
ml <- (8*k)+(8*l)-(l^2)
mk <- (8*l)
ml/mk
ml/mk
lower=-pi/2
upper=pi/2
x=seq(lower,upper,by=0.0001)
y=(cos(400*x)*sqrt(cos(x))+sqrt(abs(x)))*(4-(x^2))^0.1
plot(x,y,type="l",col="red",lwd=8)
text(0,0.75," R & Python!",cex=3.3)
unclass(as.Date("1971-01-01"))
v1 <- c(1,2,3)
v2 <- data.frame(c(4,5,6))
cbind(v1, v2)
str(cbind(v1, v2))
st <- as.Date("2020/2/18")
st <- as.Date("2020/2/18")
sd<- as.Date("2020/1/3")
st - sd
st <- as.Date("2020/2/28")
sd<- as.Date("2020/1/3")
st - sd
sd - st
ls()
list.objects()
getws()
install.packages("reticulate")
install.packages("png")
data()
data("cars")
cars <- data("cars")
cars <- data("cars")$cars
rm(cars)
cars
rm(petals)
petals
mtcars
data <- mtcars
dim(data)
dist(data$mpg)
plot.dist(data$mpg)
plot.hist(data$mpg)
hist(data$mpg)
hist(data$mpg, bins = "20")
hist(data$mpg, breaks = 4)
hist(data$mpg, breaks = 10)
hist(data$mpg, breaks = 100)
library(dplyr)
setosa
data()
data <- iris
data <- data %>% group_by(Species)
data
iris
data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
mean = mean(Sepal.Length, na.rm = TRUE),
std = sd(Sepal.Length, na.rm = TRUE)
)
data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
mean = mean(Sepal.Length, na.rm = TRUE),
std = sd(Sepal.Length, na.rm = TRUE)
)
data
data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
'mean sepal length' = mean(Sepal.Length, na.rm = TRUE),
std sepal length = sd(Sepal.Length, na.rm = TRUE)
)
data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
mean sepal length = mean(Sepal.Length, na.rm = TRUE),
std sepal length = sd(Sepal.Length, na.rm = TRUE)
)
data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
'mean sepal length' = mean(Sepal.Length, na.rm = TRUE),
'std sepal length' = sd(Sepal.Length, na.rm = TRUE)
)
data <- iris
df <- data %>%
group_by(Species) %>%
summarise(
count = n(),
'mean sepal length' = mean(Sepal.Length, na.rm = TRUE),
'std sepal length' = sd(Sepal.Length, na.rm = TRUE)
)
df
install.packages("ggpubr")
library(ggpubr)
my_data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
'mean sepal length' = mean(Sepal.Length, na.rm = TRUE),
'std sepal length' = sd(Sepal.Length, na.rm = TRUE)
)
ggboxplot(my_data, x = "species", y = "count",
color = "species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(my_data, x = "Species", y = "count",
color = "species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(my_data, x = "Species", y = "count",
color = "Species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(my_data, x = "Species", y = "mean",
color = "Species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
my_data <- data %>%
group_by(Species) %>%
summarise(
count = n(),
mean = mean(Sepal.Length, na.rm = TRUE),
std = sd(Sepal.Length, na.rm = TRUE)
)
ggboxplot(my_data, x = "Species", y = "mean",
color = "Species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(data, x = "Species", y = Sepal.Length,
color = "Species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(data, x = "Species", y = "Sepal.Length",
color = "Species", palette = c("#00AFBB", "#E7B800", "#FC4E07"))
ggboxplot(data, x = "Species", y = "Sepal.Length",
color = "Species")
ggboxplot(data, x = "Species", y = "Sepal.Length", add = c("mean_se", "jitter")
color = "Species")
ggboxplot(data, x = "Species", y = "Sepal.Length", color = "Species")
ggline(data, x = "Species", y = "Sepal.Length", add = c("mean_se", "jitter"))
aov(Sepal.Length ~ Species, data = data)
res.aov <- aov(Sepal.Length ~ Species, data = data)
summary(res.aov)
res.aov <- aov(Species ~ Sepal.Length, data = data)
res.aov <- aov(Sepal.Width ~ Species, data = data)
summary(res.aov)
res.aov <- aov(Sepal.Width + Sepal.Length ~ Species, data = data)
summary(res.aov)
res.aov <- aov(c(Sepal.Width, Sepal.Length) ~ Species, data = data)
summary(res.aov)
res.aov <- aov(Sepal.Width + Sepal.Length ~ Species, data = data)
res.aov
summary(res.aov)
plot(res.aov)
plot(res.aov)
res.aov <- manova(Sepal.Width + Sepal.Length ~ Species, data = data)
res.aov <- manova(cbind(Sepal.Width, Sepal.Length) ~ Species, data = data)
summary(res.aov)
summary(res.aov)
summary.aov(res.aov)
library(quantmod)
ticker <- getSymbols("XOM", verbose = TRUE, src='yahoo', auto.assign=TRUE)
head(get(ticker), 5)
lineChart(Ad(get(ticker)))
q.model
head(
data.frame(
col1= OpCl(get(ticker)),
col2=Lag(OpCl(get(ticker)), 0:3)
)
)
q.model <- specifyModel(Next(OpCl(get(ticker))) ~ Lag(get(ticker),0:3))
lineChart(Ad(get(ticker)), name = "XOM Adjusted Close")
q.model <- specifyModel(Next(OpCl(get(ticker))) ~ Lag(get(ticker),0:3))
pecifyModel(Next(OpCl(get(ticker))) ~ Lag(get(ticker),0:3))
specifyModel(Next(OpCl(get(ticker))) ~ Lag(get(ticker),0:3))
Next(OpCl(get(ticker)))
specifyModel(Next(OpCl(get(ticker))) ~ Lag(get(ticker),0:3))
Lag(get(ticker),0:3)
get(ticker)
Lag(get(ticker),0:3)
Lag(get(ticker),1)
Lag(Ad(get(ticker))),1:5)
Lag(Ad(get(ticker)),1:5)
specifyModel(Next(OpCl(get(ticker))) ~ Lag(Ad(get(ticker)),1:5))
specifyModel(Next(OpCl(get(ticker))) ~ Lag(Ad(get(ticker)),1:5))
str(Lag(Ad(get(ticker)),1:5))
str(Next(OpCl(get(ticker)))
str(Next(OpCl(get(ticker)))
Next(OpCl(get(ticker))
Next(OpCl(get(ticker)))
Next(OpCl(get(ticker)))
specifyModel(Next(OpCl(get(ticker))) ~ Lag(Ad(get(ticker)),1:5))
specifyModel(Next(OpCl(get(ticker))) ~ Lag(Ad(get(ticker)),1))
specifyModel()
x <- Lag(Ad(get(ticker)), 1:5)
y <- Next(OpCl(get(ticker)))
specifyModel(y ~ x)
length(x)
x <- Lag(Ad(get(ticker)), 1)
y <- Next(OpCl(get(ticker)))
x <- x[1:(length(x) - 1), ]
y <- y[1:(length(x) - 1), ]
specifyModel(y ~ x)
x <- x[1:(length(x) - 1), ]
y <- y[1:(length(x) - 1), ]
length(x) - 1
x <- Lag(Ad(get(ticker)), 1)
x
length(x)
library(PerformanceAnalytics)
edhec
names(edhc)
names(edhec)
(43.25077 / 43.33630 ) - 1
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(table(R.bool$daily.returns))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(table(R.bool$daily.returns), col=c("darkblue","red"))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(table(R.bool$daily.returns, R.bool$daily.returns), col=c("darkblue","red"))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(ftable(R.bool$daily.returns), col=c("darkblue","red"))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
ftable(R.bool$daily.returns)
ftable(R.bool$daily.returns)
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(prop.table(table(R.bool$daily.returns)), col=c("darkblue","red"))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
library(quantmod)
ticker <- getSymbols("XOM", verbose = TRUE, src='yahoo', auto.assign=TRUE)
head(get(ticker), 5)
lineChart(Ad(get(ticker)), name = "XOM Adjusted Close")
# daily returns %
R <- dailyReturn(XOM)
R.bool <- ifelse(test=R > 0, yes=TRUE, no=FALSE)
barplot(prop.table(table(R.bool$daily.returns)), col=c("darkblue","red"))
# x <- buildModel(q.model,method='lm',training.per=c('2006-08-01','2006-09-30'))
install.packages("quantstrat")
install.packages("devtools")
require(devtools)
R.version.string
R.version.string
R.version.string
setwd("~/Desktop/financial_ml_research")
install.packages("quantstrat")
library(devtools)
#### set ENV ####
pkgs <- c("devtools", "FinancialInstrument", "PerformanceAnalytics")
install.packages(pkgs)