2
$\begingroup$

I need to model demand for server components. Server 1 & Server 2 both use Hard Drive B, Server 1 uses Network Card A, and Server 2 uses Network Card C.

Server 1     Server 2
    |           |
  --------------------
  |          |       |
NC A       HD B     NC C

Or, in a linear algebra representation:

$ \begin{bmatrix} S_1 \\ S_2 \\ Pt_A \\ Pt_B \\ Pt_C \\ \end{bmatrix} = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} Pt_A \\ Pt_B \\ Pt_C \\ \end{bmatrix} $

Currently, we're forecasting server-level and component-level demand separately. How can I forecast the components, using the server-level history as well as the component-level history? I think it's more complicated than your typical vector autoregression or even your typical hierarchical time series.

I'm trying to think about how to model this using Rob Hyndman's forecast package in R. This might be getting out of Cross Validated territory, but here's what I have:

Y = data.frame(Y1=c(10,12,6,4), Y2=c(4,18,22,32))  
P = data.frame(A=c(10,12,6,4), B=c(14,30,28,36), C=c(4,18,22,32))

comb <- cbind(Y,P)
nodes <- list(2, c(3,2))
out <- hts(comb, nodes)

plot(out)

enter image description here

Assuming that there's nothing egregiously wrong with that setup, it seems like it's forecasting both servers (Y1 & Y2) together, which isn't something I necessarily want to do.

$\endgroup$

2 Answers 2

2
$\begingroup$

The simple answer is to include the top level series, do the reconciliation, then discard the top series that you don't want. The remaining series will still be consistently reconciled to each other.

A more complicated solution which avoids using the top level series is to follow Stephan's advice and apply the weighted least squares estimator directly. (See http://robjhyndman.com/papers/hgts4.pdf for the equations). This possibility is not explicitly provided for by the hts package. For small hierarchies, you can simply use the lm function with a weight argument. For larger hierarchies, you will probably need to use the SparseM package.

$\endgroup$
2
$\begingroup$

Your matrix representation is already a step in the right direction. I'd recommend taking your separate forecasts and combining them using Hyndman et al.'s (2011) optimal combination approach. You will need exactly the summation matrix you created. One advantage of this combination approach is that it does not matter where your original forecasts come from. In my experience, it does not only yield sum-consistent forecasts, but improves forecast accuracy in your entire hierarchy.

This approach is implemented in Hyndman's hts package for R.

Hyndman, R. J.; Ahmed, R. A.; Athanasopoulos, G. & Shang, H. L. Optimal combination forecasts for hierarchical time series. Computational Statistics & Data Analysis, 2011, 55, 2579-2589

$\endgroup$
2
  • $\begingroup$ Thanks! I've looked (and am looking) at $hts$, but I'm not sure how to go about it. I guess I can't format comments the way I want, so I'll go back to my question... $\endgroup$
    – Stephen C
    Commented Jun 5, 2015 at 21:23
  • $\begingroup$ (Sorry it took me a while.) It does seem like hts requires a single root node (I don't see how the nodes argument could otherwise make sense). So your hierarchy could not be modelable using hts. This is not really good, because your hierarchy certainly makes sense, but forcing a single root doesn't. Two options: (1) email the maintainer, Rob Hyndman, or (2) do the hierarchical consolidation yourself, it really isn't hard. If you don't have the paper, ask Rob to mail his 2006 ISF presentation to you - all you need is there. $\endgroup$ Commented Jun 8, 2015 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.