รายงานการศึกษาค่าคาดการณ์อัตราการว่างงานของประเทศไทย
89 2.3.1 กำลังแรงงานรวม ## Data tsibble ## library(fpp 3) data_labour <- Dataset_LF_UNEM_RATE_Forecast |> mutate(Mth = yearmonth(Month)) |> select(-Month) |> as_tsibble(index = Mth) autoplot(data_labour) #### ARIMAX #### fit_labour <- data_labour |> model(ARIMA(LF ~ COVID, stepwise = F , approx=F)) report(fit_labour) labour_fc <- new_data(data_labour, 60) |> mutate(COVID = 0) forecast(fit_labour, new_data = labour_fc) |> autoplot(data_labour) + autolayer(fitted(fit_labour),col="blue", linewidth = 0.1) + labs(title="Labour Force ( 100%)" , y = "Labour Force") augment(fit_labour) |> features(.innov, ljung_box, dof = 5 , lag = 36) fit_labour |> accuracy() gg_tsresiduals(fit_labour) fc_labour <- forecast(fit_labour, new_data = labour_fc) View(fc_labour) View(tail(fitted(fit_labour), 12)) ## Train Test ## train_labour <- data_labour |> filter_index(~ " 2020 Dec") test_labour <- data_labour |> filter_index(" 2021 Jan"~.) fit_train_labour <- train_labour |> model(ARIMA(LF ~ COVID, stepwise = F , approx=F)) report(fit_train_labour) fc_test_labour <- new_data(train_labour, 24) |> mutate(COVID = test_labour$COVID) forecast(fit_train_labour, new_data = fc_test_labour) |> autoplot(data_labour) + autolayer(fitted(fit_train_labour),col="blue", linewidth = 0.1) + labs(title="Labour Force (Train:Test)", y = "Labour Force") augment(fit_train_labour) |> features(.innov, ljung_box, dof = 4 , lag = 36) fit_train_labour |> accuracy() fit_train_labour |> forecast(new_data = fc_test_labour) |> accuracy(test_labour) gg_tsresiduals(fit_train_labour) fc_t_labour <- forecast(fit_train_labour, new_data = fc_test_labour) View(fc_t_labour) 2.3.2 จำนวนผู้ว่างาน ## Data tsibble ## library(fpp 3) data <- Dataset_LF_UNEM_RATE_Forecast |> mutate(Mth = yearmonth(Month)) |>
Made with FlippingBook
RkJQdWJsaXNoZXIy MTA3NzA0Nw==