I want to implement a Kalman filter to predict the actual daily number of dine-in customers in a restaurant with the two sets of time series data below.
- Daily total number of people entering the restaurant: This is not exactly the same as the number of dine-in customers because it also includes the number of staffs and take-away customers entering the restaurant.
- Daily total number of main dishes sold (dine-in): This is not exactly the same as the number of dine-in customers because some customers may order more than one main dish while some customers may not order any main dish at all.
With the above, how should I set the equations for implementing a Kalman filter to make the best guess of the actual number of dine-in customers?
You must have some relations between the data in order to formulate a Kalman Filtering Problem. The State Equations must be in this format:
State Transition: x_(k+1) = Ak * x_k + Bk * u_k
Measurement: yk = Ck * x_k + Dk * u_k
Your measurements are the datasets you have:
y1: Customers Entered
y2: Dishes Ordered
Let me setup some example equations:
Let the states be:
x1: Number of dine in customers
x2: Number of Staff
x3: Number of takeaway customers
Now y1 = x1 + x2 + x3
y2 = 4 * x1 + 5 * x3
This gives you the C matrix
You must still define an A matrix that defines a relationship between current customers at step k and the customers coming next at step k+1.
Without these relations, you might not have a Kalman Filtering problem.