The issue regards an algorithm for iterative approximation of unknown transaction values. For each iteration (each day), we are give the total revenue of all transactions for that day, and we have the number of transactions of each type. The goal is to estimate the transaction value for each transaction type. This means, that each day we have an equation on this form (x denoting number of transactions for the given type, v denoting the value for the transaction of the given type):
$$x_{1} * v_{1} + x_{2} * v_{2} + ... x_{n} * v_{n} = revenue$$
With real collected data inserted, it could look for example like this for a given day (with four different transaction types):
$$4 * v_{1} + 2 * v_{2} + 8 * v_{3} + 7 * v_{4} = 83$$
As the number of each transaction type varies each day (and with that, the total value), we can use this to determine how big an effect each transaction type has on the total value, and with that iteratively move closer and closer to the real values for each transaction type. However, I have one big problem here: the values of the transaction types are not constant, but rather changing from day to day. I've found this to be a serious problem for the approximation approach that I'm using (which for constant values otherwise has proven quite effective).
My question is: Is there an efficient method of (iteratively or not) approximating these transaction values, despite the fact that they are not constant over time?
For those interested, here is the iterative approximation approach I've evaluated so far but that isn't fully optimal for this situation with changing transaction values:
1. Check how much a calculated total revenue for today (using the approximated values for each transaction type from the previous day) deviates from the actual total revenue for today:
$$deviation=revenue_{today}-\sum (v_{yesterday}*x_{today})$$
2. Next, we calculate a weighted avg diff:
$$weightedDiff=deviation*\frac{\sum x_{today}}{\sum (x_{today}^2)}$$
3. Finally, we need to adjust our previously calculated value per transaction type, to make sure we eliminate the deviation for today. The adjustments are done with the weighted avg diff and according to the number of transaction of each type:
$$v_{today}=v_{yesterday}+weightedDiff*\frac{x_{today}}{\sum x_{today}}$$
The above algo works very well when transaction values are constant - less well if they are not.
Thanks a lot for any input on this topic :)