รายงานการศึกษาค่าคาดการณ์อัตราการว่างงานของประเทศไทย

83 "Regression residuals", "ARIMA residuals")) ) |> ggplot(aes(x = Year, y = .resid)) + geom_line() + facet_grid(vars(type)) fit_train |> gg_tsresiduals() augment(fit_train) |> features(.innov, ljung_box, dof = 2, lag = 10) #Forecast Test Data (2020 - 2022) data_test <- new_data(train, 2) |> mutate(COVID = test$COVID, GDPt = test$GDPt) fit_train |> forecast(new_data = data_test) |> autoplot(data) + autolayer(fitted(fit_train),col="blue", linewidth = 0.02) + labs(title = "ARIMAX ~ covid + GDPt", subtitle = "Train - Test", y = "Unemployment Rate") #Evaluate Model #In-sample training accuracy fit_train |> accuracy() #Out-of-sample forecast accuracy fit_train |> forecast(new_data = data_test) |> accuracy(test) # 100% Data #Fit Model fit <- data[-c(23:25),]|> model(ARIMA(UNEM_RATE ~ COVID+GDPt , stepwise = FALSE, approx = FALSE)) report(fit) #Residual Check bind_rows( `Regression residuals` = as_tibble(residuals(fit, type = "regression")), `ARIMA residuals` = as_tibble(residuals(fit, type = "innovation")), .id = "type" ) |> mutate( type = factor(type, levels=c( "Regression residuals", "ARIMA residuals")) ) |> ggplot(aes(x = Year, y = .resid)) + geom_line() + facet_grid(vars(type)) fit |> gg_tsresiduals() augment(fit) |> features(.innov, ljung_box, dof = 0, lag = 10) #Forecast 2023 - 2025 ARIMAX ~ covid f_GDP <- data |> filter(Year > 2022 & Year <= 2025 ) data_future <- new_data(data[-c(23:25),], 3) |> mutate(COVID = f_GDP$COVID, GDPt = f_GDP$GDPt) fit |> forecast(new_data = data_future) |> autoplot(data) + autolayer(fitted(fit),col="blue", linewidth = 0.02) + labs(title = "ARIMAX ~ covid + GDPt", subtitle = "Forecast 2023 - 2025", y = "Unemployment Rate") a <- forecast(fit, new_data = data_future) view(a)

RkJQdWJsaXNoZXIy MTA3NzA0Nw==