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

85 #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 = Quarter, y = .resid)) + geom_line() + facet_grid(vars(type)) fit |> gg_tsresiduals() augment(fit) |> features(.innov, ljung_box, dof = 2 , lag = 20) #Forecast 2023 Q 1 - 2025 Q 4 ARIMAX ~ covid + GDPt #Forecast GDP 2023 Q 1 - 2025 Q 4 fit_GDP <- data |> model(ARIMA(GDPt_ 3 , stepwise = FALSE, approx = FALSE)) report(fit_GDP) fit_GDP |> forecast(h= 12) |> autoplot(data) + labs(title = "GDP Forecast") f_GDP <- forecast(fit_GDP, h= 12) view(f_GDP) data_future <- new_data(data, 12) |> mutate(COVID = 0 , GDPt_ 3 = f_GDP$.mean) fit |> forecast(new_data = data_future) |> autoplot(data) + autolayer(fitted(fit),col="blue", linewidth = 0.02) + labs(title = "ARIMAX ~ covid + GDPt_ 3" , subtitle = "Forecast 2023 Q 1 - 2025 Q 4 " , y = "Labourforce") a <- forecast(fit, new_data = data_future) view(a) #Evaluate Model #In-sample training accuracy fit |> accuracy() 2.2.2 จำนวนผู้ว่างงาน data |> autoplot(UNEM) #Fit Model for Train fit_train <- train |> model(ARIMA(log(UNEM) ~ COVID+GDPt, stepwise = FALSE, approx = FALSE)) report(fit_train) #Residual Check bind_rows( `Regression residuals` = as_tibble(residuals(fit_train, type = "regression")), `ARIMA residuals` = as_tibble(residuals(fit_train, type = "innovation")), . id = "type" ) |> mutate( type = factor(type, levels=c( " Regression residuals", "ARIMA residuals")) ) |> ggplot(aes(x = Quarter, y = .resid)) + geom_line() + facet_grid(vars(type))

RkJQdWJsaXNoZXIy MTA3NzA0Nw==