I’m trying to model the following problem. I have a list of number of units sold per day during a period of time. I have a model for the demand of the product (a seasonal Poisson regression, which is not important here). I want to link the model with the observations, knowing that there are sales only when there is enough stock:
demand_t ~ Poisson(…)
sales_t = min(demand_t, stock_t)
observations = sales_t
The problem with this is that sales_t is Deterministic, which cannot be given the obs= parameter. Is there a workaround?