รายงานการศึกษาค่าคาดการณ์อัตราการว่างงานของประเทศไทย
88 augment(fit) |> features(.innov, ljung_box, dof = 3 , 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, 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 = f_GDP$.mean) fit |> forecast(new_data = data_future) |> autoplot(data) + autolayer(fitted(fit),col="blue", linewidth = 0.02) + labs(title = "ARIMAX ~ covid + GDPt", subtitle = "Forecast 2023 Q 1 - 2025 Q 4 " , y = "Unemployment Rate") a <- forecast(fit, new_data = data_future) view(a) #Evaluate Model #In-sample training accuracy fit |> accuracy() 2.3 ชุดคำสั่งการพยากรณ์รายเดือน ### Impute missing data ### library(fpp 2) library(imputeTS) #Labour Force LF_ms <- ts(Dataset_LF_UNEM_Forecast_$LF, frequency= 12 ,start= 2002) LF_data_seadec <- na_seadec(LF_ms) LF_data_ma <- na_ma(LF_ms) write.xlsx(LF_data_seadec, file = "LF_data_impute_seadec.xlsx") write.xlsx(LF_data_ma, file = "LF_data_impute_ma.xlsx") #Unemploy UNEM_ms <- ts(Dataset_LF_UNEM_Forecast_$UNEM, frequency= 12 ,start= 2002) UNEM_data_seadec <- na_seadec(UNEM_ms) UNEM_data_ma <- na_ma(UNEM_ms) write.xlsx(UNEM_data_seadec, file = "UNEM_data_impute_seadec.xlsx") write.xlsx(UNEM_data_ma, file = "UNEM_data_impute_ma.xlsx") #Unemploy Rate RATE_ms <- ts(Dataset_UNEM_RATE_Forecast$UNEM_RATE, frequency= 12 ,start= 2002) RATE_data_seadec <- na_seadec(RATE_ms) RATE_data_ma <- na_ma(RATE_ms) write.xlsx(RATE_data_seadec, file = "RATE_data_impute_seadec.xlsx") write.xlsx(RATE_data_ma, file = "RATE_data_impute_ma.xlsx")
Made with FlippingBook
RkJQdWJsaXNoZXIy MTA3NzA0Nw==