Dosen Pengampu : Prof. Dr. Suhartono, M.Kom
Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang
Jurusan : Teknik Informatika
Fakultas : Sains dan Teknologi
Banyaknya uang yang beredar di masyarakat akan berpengaruh pada kondisi perekonomian suatu negara. Bank Indonesia memiliki tujuan tunggal untuk mencapai dan menjaga kestabilan nilai rupiah. Oleh karena itu, BI sebagai bank sentral menyusun perencanaan untuk memenuhi kebutuhan uang rupiah. Perencanaan tersebut dapat dilakukan dengan melakukan peramalan untuk inflow dan outflow uang kartal. Inflow merupakan uang yang masuk ke BI melalui kegiatan penyetoran, sedangkan outflow merupakan uang yang keluar dari BI melalui kegiatan penarikan.
library(readxl)
## Warning: package 'readxl' was built under R version 4.1.2
datainflowperbulan <- read_excel(path = "~/linear algebra/inflow kalimantan perbulan.xlsx")
library(readxl)
dataoutflowperbulan <- read_excel(path = "~/linear algebra/Outflow kalimantan perbulan.xlsx")
datainflowperbulan
## # A tibble: 128 x 7
## Keterangan Kalimantan `Kalimantan Barat` `Kalimantan Tengah`
## <dttm> <dbl> <dbl> <dbl>
## 1 2011-01-01 00:00:00 982. 54.5 105.
## 2 2011-02-01 00:00:00 486. 40.8 55.8
## 3 2011-03-01 00:00:00 1150. 259. 64.3
## 4 2011-04-01 00:00:00 612. 91.0 45.2
## 5 2011-05-01 00:00:00 887. 217. 46.0
## 6 2011-06-01 00:00:00 850. 156. 74.6
## 7 2011-07-01 00:00:00 853. 189. 34.2
## 8 2011-08-01 00:00:00 648. 121. 24.0
## 9 2011-09-01 00:00:00 3685. 891. 213.
## 10 2011-10-01 00:00:00 1076. 296. 29.7
## # ... with 118 more rows, and 3 more variables: `Kalimantan Selatan` <dbl>,
## # `Kalimantan Timur` <dbl>, `Kalimantan Utara` <dbl>
dataoutflowperbulan
## # A tibble: 128 x 7
## Keterangan Kalimantan `Kalimantan Barat` `Kalimantan Tengah`
## <dttm> <dbl> <dbl> <dbl>
## 1 2011-01-01 00:00:00 582. 278. 167.
## 2 2011-02-01 00:00:00 859. 141. 318.
## 3 2011-03-01 00:00:00 1570. 155. 375.
## 4 2011-04-01 00:00:00 2337. 535. 591.
## 5 2011-05-01 00:00:00 2019. 272. 559.
## 6 2011-06-01 00:00:00 2439. 446. 657.
## 7 2011-07-01 00:00:00 2544. 436. 681.
## 8 2011-08-01 00:00:00 6258. 1040. 1030.
## 9 2011-09-01 00:00:00 671. 146. 175.
## 10 2011-10-01 00:00:00 2175. 217. 598.
## # ... with 118 more rows, and 3 more variables: `Kalimantan Selatan` <dbl>,
## # `Kalimantan Timur` <dbl>, `Kalimantan Utara` <dbl>
plot(datainflowperbulan$`Kalimantan Barat`,type = "l", col = "red")
lines(dataoutflowperbulan$`Kalimantan Barat`,col = "green")
legend("top", c("Inflow","Outflow"),fill = c("red","green"))
kalimantanbarattimeseries <- datainflowperbulan$`Kalimantan Barat`
plot.ts(kalimantanbarattimeseries, type = "l", col = "orange")
logKalimantanbarat <- log(datainflowperbulan$`Kalimantan Barat`)
plot.ts(logKalimantanbarat, type = "l", col = "blue")
library(TTR)
## Warning: package 'TTR' was built under R version 4.1.3
KalimantanbaratSMA3 <- SMA(datainflowperbulan$`Kalimantan Barat`,n=8)
plot.ts(KalimantanbaratSMA3)
kalimantanbaratinflowtimeseries <- ts(datainflowperbulan$`Kalimantan Barat`, frequency = 12, start = c(2011,1))
kalimantanbaratinflowtimeseries
## Jan Feb Mar Apr May Jun
## 2011 54.52903 40.77704 259.13753 90.97985 217.30091 156.45543
## 2012 554.21108 378.73583 275.40764 296.27418 199.65298 155.91181
## 2013 803.26038 289.11069 304.60544 404.76609 210.38169 232.54107
## 2014 897.16664 527.16265 393.59430 418.63956 331.61535 445.88874
## 2015 1320.97801 362.76288 632.01713 408.00876 318.30169 346.34378
## 2016 988.75508 806.80619 638.72282 409.60413 448.29223 275.91308
## 2017 960.95382 682.81728 537.12035 497.89399 530.62622 264.67476
## 2018 1521.58177 574.51997 623.75708 652.43127 549.84177 1738.46097
## 2019 1790.66589 817.42579 838.43411 732.16921 530.31507 2467.54886
## 2020 1753.44076 1017.45314 581.59030 575.08340 848.60905 1253.24845
## 2021 2148.58661 857.40587 826.18841 604.95489 1360.46043 747.64070
## Jul Aug Sep Oct Nov Dec
## 2011 189.01409 120.68323 891.46424 295.89249 324.59072 190.01048
## 2012 281.71936 389.11640 410.17925 110.60402 259.14774 74.69476
## 2013 111.53951 1045.02374 182.96058 218.40604 173.62279 52.92774
## 2014 81.52122 1495.60233 493.05495 498.10248 237.79299 122.38756
## 2015 1218.50175 584.57309 433.13373 430.96591 261.72634 358.17088
## 2016 1529.45460 599.69187 558.51450 394.94231 430.61696 358.46736
## 2017 1634.88262 547.52037 607.96510 544.96541 500.59565 464.73927
## 2018 1121.97630 628.59937 758.17154 831.56893 691.39250 556.40304
## 2019 984.15747 942.05315 854.39510 785.49203 732.92579 371.99084
## 2020 628.95510 715.90227 693.42169 334.65855 619.15835 272.93062
## 2021 407.87206 644.62140
Kalimantanbaratoutflowtimeseries <- ts(dataoutflowperbulan$`Kalimantan Barat`, frequency = 12, start = c(2011,1))
Kalimantanbaratoutflowtimeseries
## Jan Feb Mar Apr May Jun
## 2011 278.37414 140.57045 155.30094 534.67670 271.63314 446.00305
## 2012 427.27419 188.70412 228.49078 463.10707 437.63095 427.52360
## 2013 189.09534 107.42857 227.01437 269.32429 315.74429 376.02955
## 2014 215.89969 172.52771 239.92174 548.44918 457.10510 493.40500
## 2015 141.38835 422.25947 403.69730 544.78024 617.68875 915.31132
## 2016 186.62621 363.22680 411.47885 588.48714 888.21262 2146.74210
## 2017 363.11931 490.14981 468.73932 655.84722 842.78603 2495.50597
## 2018 133.48537 758.56888 685.85240 617.40535 1542.99538 2409.70567
## 2019 246.09331 640.97200 660.94259 1241.08393 3432.22445 77.51182
## 2020 372.80013 446.36304 856.52520 1453.91208 1769.47074 325.66212
## 2021 26.53755 531.20752 760.51353 1521.69259 1773.30274 634.22032
## Jul Aug Sep Oct Nov Dec
## 2011 435.85810 1039.53103 146.16216 216.84672 524.44890 1031.98540
## 2012 538.25954 878.30406 44.78650 518.33851 300.09053 1245.58814
## 2013 1300.62662 533.06895 219.03458 544.42063 404.43786 1524.86560
## 2014 1726.14834 295.23448 449.85115 423.49304 471.75388 1270.01026
## 2015 1644.33397 303.55670 456.42911 479.52159 653.05640 1903.58785
## 2016 469.98540 472.45871 779.14595 620.28463 920.49715 1555.06951
## 2017 227.28746 907.36011 596.94924 772.13991 1173.78035 2138.64459
## 2018 446.18321 999.25479 600.07518 863.63900 844.04957 2376.37449
## 2019 1029.75499 992.18920 716.86572 936.00870 1077.25427 2716.75786
## 2020 1160.00272 850.34828 984.22695 1352.99705 1016.64561 2911.55021
## 2021 1030.85375 679.97284
plot.ts(kalimantanbaratinflowtimeseries)
plot.ts(Kalimantanbaratoutflowtimeseries)
Kalimantanbaratintimeseriescomponents <- decompose(kalimantanbaratinflowtimeseries)
Kalimantanbaratintimeseriescomponents$seasonal
## Jan Feb Mar Apr May Jun
## 2011 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2012 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2013 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2014 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2015 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2016 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2017 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2018 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2019 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2020 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## 2021 643.863115 -1.771843 -80.503334 -127.585787 -176.599502 178.641254
## Jul Aug Sep Oct Nov Dec
## 2011 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2012 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2013 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2014 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2015 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2016 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2017 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2018 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2019 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2020 187.979123 104.555644 -19.760201 -168.030727 -196.338290 -344.449452
## 2021 187.979123 104.555644
Kalimantanbaratouttimeseriescomponents <- decompose(Kalimantanbaratoutflowtimeseries)
Kalimantanbaratouttimeseriescomponents$seasonal
## Jan Feb Mar Apr May Jun
## 2011 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2012 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2013 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2014 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2015 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2016 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2017 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2018 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2019 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2020 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## 2021 -572.27584 -391.34798 -307.50008 -72.22509 355.95425 274.25596
## Jul Aug Sep Oct Nov Dec
## 2011 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2012 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2013 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2014 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2015 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2016 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2017 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2018 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2019 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2020 127.37235 -43.91939 -275.84674 -109.06470 -53.60175 1068.19899
## 2021 127.37235 -43.91939
plot(Kalimantanbaratintimeseriescomponents$seasonal,type = "l", col = "green")
lines(Kalimantanbaratouttimeseriescomponents$seasonal, col = "orange")
legend("top", c("Inflow","outflow"),fill = c("green","orange"))
plot(Kalimantanbaratintimeseriescomponents$trend, type = "l", col = "green")
lines(Kalimantanbaratouttimeseriescomponents$trend, col="black")
legend("top",c("Inflow","Outflow"),fill = c("green","black"))
plot(Kalimantanbaratintimeseriescomponents$random,type = "l", col = "green")
lines(Kalimantanbaratouttimeseriescomponents$random,col = "black")
legend("top",c("Inflow","Outflow"),fill = c("green","black"))