구축 방법 — Forecasting · v1.0 · 2026-10-26
■ 방법
- 실측 시간별 기온에 고전 예측법과 브라우저에서 학습하는 모델을 적용해 시간 순서로 평가
- 탭 5개: Decomposition / Baselines / Smoothing & ARIMA / ML Forecasting / Evaluation
- 분해: 2×24 가운데 이동 평균 추세, 시각별 평균 계절, 나머지(statsmodels seasonal_decompose two_sided와 같은 방식). ACF: 표본 자기상관(adjusted 아님)
- 기준선: naive, seasonal naive(24시간), 이동 평균(w 3–72시간)
- Holt-Winters 가법: 주기 24, 초기값 = 첫 주기 평균·(둘째−첫 주기 평균)/24·첫 주기 − 수준(정한 방식), 예측 시점 전 14일로 맞춤. α β γ 자동 = 한 시간 앞 오차제곱합 최소 격자 탐색(α 8 × β 4 × γ 6)
- 계절 차분 + AR(p): 24시간 차분 뒤 p 1–8 자기회귀를 최소제곱(30일)으로 = SARIMA(p,0,0)(0,1,0)₂₄
- 학습 모델: 특징 = 지연 1..L(1–24), 24시간 전, 시각 sin·cos(표준화). Ridge(λ 0–10⁴, 절편 벌점 없음) 또는 tanh 은닉 16 신경망(Adam lr 0.01, 묶음 32, 2,500단계, 시드 1). 여러 시간 앞은 재귀 예측
- 평가: 그 달 매일 00시 rolling origin, 1–48시간 앞 MAE·RMSE·MAPE. 누수 체험: 24시간 앞 직접 ridge(L 6, λ 1)를 무작위 80/20 vs 시간 순 80/20
- 직접 쓴 JavaScript(forecast-core.js), 외부 라이브러리 없음 · LLM 없음
■ 데이터
- NREL TMY3 723170 Greensboro Piedmont Triad Intl, NC(UTC−5) · 건구 온도 시간별 8,760개 · pvlib 0.16.1에 들어 있는 예시 파일(BSD-3-Clause 배포) · SHA-256 1e96f846…0c6c9
- 성격: 전형 기상년. 달마다 다른 해의 실측 한 달(1월 1988, 2월 1996, 3월 1990, 4월 1980, 5월 1986, 6월 1989, 7월 1981, 8월 2001, 9월 2003, 10월 1980, 11월 1994, 12월 1980)을 이어 붙여 달 경계가 이어지지 않음
- 처음 계획(UCI 가구 전력 사용 데이터)은 이 작업 환경에서 UCI 저장소 접속이 막혀 바꿈(2026-10-26)
- 사용자 입력 저장 없음
■ 검증
- statsmodels 0.15.0·NumPy 2.5.3 대조(tests/forecasting/core-test.mjs): 분해 추세·계절 최대 차이 4.9e-11 · ACF 72 lag 5.0e-11 · Holt-Winters 1–23시간 앞 4.9e-11(24시간 앞은 계절값 고르는 관례 차이로 0.29 °C) · AR(3) 계수 2.2e-11
- Rolling origin, 4월(1980) 매일 00시 27번, MAE °C 1/6/24시간 앞: naive 0.86/2.99/3.66 · seasonal naive 3.86/4.26/3.66 · Holt-Winters(자동 α β γ) 0.86/3.08/4.39 · AR(3) 0.99/2.73/3.54 · ridge(L 6) 0.69/2.42/3.46
- 12월(1980)은 실제 값이 0.0 °C인 시각이 있어 6시간 앞 MAPE가 10,000 %를 넘음(화면에는 "> 10,000"). 같은 달 MAE는 2.4–4.3 °C
- 누수 체험(24시간 앞, 한 해 8,688행): 무작위 분할 MAE 3.18 °C · 시간 순 분할 3.82 °C (시간 순이 20% 큼)
- 학습·평가 분리: 모든 예측은 예측 시점 이전 값만으로 학습
■ 범위
- 한 지점·한 해의 외기온, 1–48시간 앞, 입력은 지난 기온뿐(일기 예보·다른 변수 없음). 건물 에너지 자체는 예측하지 않음
■ 출처
- Hyndman, R.J., Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.
- Winters, P.R. (1960). Forecasting sales by exponentially weighted moving averages. Management Science 6(3).
- Box, G.E.P., Jenkins, G.M., Reinsel, G.C., Ljung, G.M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.
- Hoerl, A.E., Kennard, R.W. (1970). Ridge regression: biased estimation for nonorthogonal problems. Technometrics 12(1).
- Tashman, L.J. (2000). Out-of-sample tests of forecasting accuracy: an analysis and review. International Journal of Forecasting 16(4).
- Hyndman, R.J., Koehler, A.B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting 22(4).
- Bergmeir, C., Benítez, J.M. (2012). On the use of cross-validation for time series predictor evaluation. Information Sciences 191.
- Wilcox, S., Marion, W. (2008). Users Manual for TMY3 Data Sets. NREL/TP-581-43156.
- Holmgren, W.F., Hansen, C.W., Mikofski, M.A. (2018). pvlib python. Journal of Open Source Software 3(29).
- 데이터: NREL TMY3 723170 (pvlib 0.16.1 data/723170TYA.CSV) · pvlib BSD-3-Clause
How it's built — Forecasting · v1.0 · 2026-10-26
■ Method
- Classical forecasting methods and models trained in the browser, applied to measured hourly temperature and evaluated in time order
- 5 tabs: Decomposition / Baselines / Smoothing & ARIMA / ML Forecasting / Evaluation
- Decomposition: 2×24 centered moving-average trend, hour-of-day mean seasonal, remainder (same as statsmodels seasonal_decompose two_sided). ACF: sample autocorrelation (not adjusted)
- Baselines: naive, seasonal naive (24 h), moving average (w 3–72 h)
- Additive Holt-Winters: period 24, initial values = first-cycle mean, (second − first cycle mean)/24, first cycle − level (chosen scheme), fitted on the 14 days before the forecast. Automatic α β γ = grid search minimizing one-step squared error (α 8 × β 4 × γ 6)
- Seasonal difference + AR(p): 24-hour differencing, then a p = 1–8 autoregression by least squares on 30 days = SARIMA(p,0,0)(0,1,0)₂₄
- Learned models: features = lags 1..L (1–24), 24 h earlier, hour-of-day sine and cosine (standardized). Ridge (λ 0–10⁴, intercept unpenalized) or a 16-unit tanh network (Adam lr 0.01, batch 32, 2,500 steps, seed 1). Multi-step forecasts are recursive
- Evaluation: rolling origin at 00:00 every day of the month, MAE, RMSE, MAPE at 1–48 h. Leakage demo: direct 24 h ridge (L 6, λ 1), random 80/20 vs time-ordered 80/20
- Hand-written JavaScript (forecast-core.js), no external libraries · No LLM
■ Data
- NREL TMY3 723170 Greensboro Piedmont Triad Intl, NC (UTC−5) · 8,760 hourly dry-bulb temperatures · sample file shipped with pvlib 0.16.1 (distributed under BSD-3-Clause) · SHA-256 1e96f846…0c6c9
- Type: typical meteorological year. Each month is a measured month from a different year (Jan 1988, Feb 1996, Mar 1990, Apr 1980, May 1986, Jun 1989, Jul 1981, Aug 2001, Sep 2003, Oct 1980, Nov 1994, Dec 1980), so month boundaries do not join smoothly
- The original plan (UCI household power data) was changed because the UCI repository could not be reached from this work environment (2026-10-26)
- User input stored: none
■ Validation
- Against statsmodels 0.15.0 and NumPy 2.5.3 (tests/forecasting/core-test.mjs): decomposition trend and seasonal max difference 4.9e-11 · ACF 72 lags 5.0e-11 · Holt-Winters 1–23 h ahead 4.9e-11 (0.29 °C at 24 h from a different convention for picking the seasonal term) · AR(3) coefficients 2.2e-11
- Rolling origin, April (1980), 27 forecasts at 00:00, MAE °C at 1/6/24 h: naive 0.86/2.99/3.66 · seasonal naive 3.86/4.26/3.66 · Holt-Winters (automatic α β γ) 0.86/3.08/4.39 · AR(3) 0.99/2.73/3.54 · ridge (L 6) 0.69/2.42/3.46
- In December (1980) some true values are exactly 0.0 °C, so 6 h MAPE exceeds 10,000 % (shown as "> 10,000"). MAE in the same month is 2.4–4.3 °C
- Leakage demo (24 h ahead, 8,688 rows over the year): random split MAE 3.18 °C · time split 3.82 °C (time split 20% larger)
- Training and evaluation separated: every forecast is trained only on values before the forecast time
■ Scope
- Outdoor temperature at one site for one year, 1–48 h ahead, past temperature as the only input (no weather forecast or other variables). Building energy itself is not forecast
■ Sources
- Hyndman, R.J., Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.
- Winters, P.R. (1960). Forecasting sales by exponentially weighted moving averages. Management Science 6(3).
- Box, G.E.P., Jenkins, G.M., Reinsel, G.C., Ljung, G.M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.
- Hoerl, A.E., Kennard, R.W. (1970). Ridge regression: biased estimation for nonorthogonal problems. Technometrics 12(1).
- Tashman, L.J. (2000). Out-of-sample tests of forecasting accuracy: an analysis and review. International Journal of Forecasting 16(4).
- Hyndman, R.J., Koehler, A.B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting 22(4).
- Bergmeir, C., Benítez, J.M. (2012). On the use of cross-validation for time series predictor evaluation. Information Sciences 191.
- Wilcox, S., Marion, W. (2008). Users Manual for TMY3 Data Sets. NREL/TP-581-43156.
- Holmgren, W.F., Hansen, C.W., Mikofski, M.A. (2018). pvlib python. Journal of Open Source Software 3(29).
- Data: NREL TMY3 723170 (pvlib 0.16.1 data/723170TYA.CSV) · pvlib BSD-3-Clause
■ History
- 2026-10-26 · v1.0 · Released