Based on my research and (limited) understanding, I am finding that hierarchical time series modeling works by summing the nodes below to create a total value at the higher levels. I am trying to use the mean for the lowest level (mean rent prices) and want to use a hierarchical model to predict mean prices within zip codes, cities, and other higher levels. (I dont have the total number available for each zip, so I am assuming the n are equivalent in each bottom node) Is this possible?
I have been using fable in R (basing my work on Hyndman's Australian Tourism example) to build the model. But it seems to not work with using the mean.
Here is some of my code:
zri_leveled <- zri %>%
aggregate_key((State/CountyName/City/zip), mean_rent = mean(avg_rent))
fit <- zri_VA_leveled %>%
filter_index(~"2018-12") %>%
model(base = ETS(mean_rent)) %>%
reconcile(
bu = bottom_up(base),
ols = min_trace(base, method = "ols"),
mint = min_trace(base, method = "mint_shrink"),
)
The data includes:
For levels, States, County, City, Zipcode. Dates are in months. And average rents are integers.
I hope to include other features (some will be the means and some will be indexes) later, but first I would like to get this hierarchical model working.
I appreciate any help.