Miscellaneous Topics for Final STAT 730 Lecture =============================================== 5/8/2026 i. Smoothing of trend and better decomposition of detrended data into seasonal and irregular components ## Following up on "trend" tmp2 found by simple moving-window filter in ## Seasonal Adjustment RLog. plot(tmp2) ## already very smooth lines(m1$data[7:317,"trend"], col="blue") ## the seasonally adjusted trend series ## had sharper blips at all by 1 stationary point According to Wikipedia, the X-13 method is given by steps 1.-8. at https://en.wikipedia.org/wiki/X-13ARIMA-SEATS We already tried the first two steps, a moving-average trend estimate; subtracted from the original data. Next smooth the seasonal. aux2 = c(unemp[1:6], unemp[7:317]-tmp2, unemp[318:323]) for(t in 25:299) aux2[t] = mean(aux2[c(t-24,t-12,t,t+12,t+24)]) unemp2 = unemp-aux2 plot(unemp) lines(1990+(6:316)/12, unemp2[7:317], col="blue") ## Now find new trend for this series using "Henderson weights" ## a kind of smoothing weights ("Whittaker-Henderson", from package WH) ## using in actuarial and financial math. unemp3 = WH(y=unemp2[7:317], wt=rep(1,311), criterion="GCV")$y_hat plot(1990+(6:316)/12, unemp3, type="b") aux3 = c(unemp[1:6], unemp[7:317]-unemp3, unemp[318:323]) for(t in 25:299) aux3[t] = mean(aux3[c(t-24,t-12,t,t+12,t+24)]) unemp3 = unemp[7:317]-aux3[7:317] par(mfrow=c(3,1)) plot(unemp, main="Original Data") plot(1990+(6:316)/12, unemp2[7:317], type="b", xlab="Time", ylab="unemp",col="blue", main="First Trend Estimate") plot(1990+(6:316)/12, unemp3, xlab="Time", ylab="unemp", main="Second Trend Estimate", type="b") plot(1990+(6:316)/12, unemp[7:317]-tmp2, xlab="Time", ylab="seas", type="l", main="First Seasonal Estimate") plot(1990+(6:316)/12, unemp[7:317]-unemp3, ylab="seas", xlab="Time", type="l", main="Second Seasonal Estimate") plot(m1$data[,"seasonal"], ylab="seas", main="Package Seasonal Estimate") ### Two pictures saved as UnempPic7.pdf and UnempPic8.pdf ### So there are more and slightly different iterative steps to do ... #----------------------------------------------------------------- ii. Stochastic regression of interventions, point occurrences, etc. Combined with Sec.5.7 Transfer Function Modeling Stochastic Regression for output series yt as linear in covariates z_t and lagged input xt with independent ARMA(p,q) autocorrelated errors y_t = z_t'\beta + \sum_{j=0}^\infty \alpha_j x_{t-j} + \eta_t Can consider first term an ordinary regression, 2nd a "distributed lag" where \alpha_j = effect at time j after point event can be modeled! Stochastic regressors z_t could be relevant covariates including residuals from another model ! x_t could either be a modelled time series as in Sec.5.7 OR an indicator like I[intervention event at time t] "Intervention event" could be point occurrence like hurricane or govt shutdown OR "trading day" effect like Christmas or Easter, and can superpose such effects as necessary. "Transfer function modeling" looks at resultant in terms of Backshift series and autocorrelations ... in Sec.5.7 Final proposal in Sec.5.7 is to minimize sum of squared innovations z_t (associated with eta_t) in residuals from y_t - z_t'\beta - \sum_{j=0}^\infty \alpha_j x_{t-j} #----------------------------------------------------------------- iii. ARMAX Sec.5.8 Here there must be exogenous inputs like z_t that are known (can be vectors) but not modeled distributed lags. This setup falls within state-space model. #----------------------------------------------------------------- iv. "Causality" -- directions of influence may not be unique when there is missing data !