I am using brms to model housing sales data, but I am not sure how to model discrete time-series inventory data. Any feeback is greatly appreicated.
The data frame contains:
project_name: string, a real estate development project
sales: integer, the number of units sold for the project (e.g., 0, 1, 2, …20, ,)
sale_month: date, e.g., 2019-12
remaining_units: integer, the number of remaining units in the inventory for the project
Usually sales date are treated as binoimal or possion distributed. I may use zero_inflated_possion or zero_inflated_negbinomial, as there are quite a few zeros (no sales for certain month). For simplicity, let’s say the data is possion or binomial distributed.
My question is how to model the autocorrelation of sales. brm has an argument of autocor to set the p, and q for autocorrelation, but I am not sure how to correctly set p and q. is there a method like auto.arima in brms to detect the p and q for a multi-level bayesian model? A trick part is that different projects start and end at different months.
I am also not sure whether remaining_units (monotonically desreasing) affects the binomial model. For example, next month remaining units = this month remaining units - sales of this month.
brm(data = dt, family = binomial,
sales | trials(remaining_units) ~ 1 + (1 | project_name),
prior = c(prior(normal(0, 1), class = Intercept),
prior(cauchy(0, 1), class = sd)),
iter = 10000, warmup = 1000)
The trick part of my current project is that there are multiple time series, as there are multiple real estate projects across the city, and the housing sales data for these projects are different.
I was planning to use brms because of the multilevel modelling part in non time series data. However, I am not sure whether brms or prophet support multi-level time series modelling such as using project as a random effect.