# Dynamic demand model in many good competitive markets and price optimization

This is a question about demand models, price optimization, dynamic pricing, big data, online learning, so I will cross-post in other communities.

$\mathbf{Background}$

I am interested in dynamic price optimization in the following situation:
* Let $q^d_t$ be the demand for product $d$ at time $t$. We model $q^d_t$ as a random process, which is observed at some random times $t_i$ at which the product $d$ is purchased.
* Let $p^d_t$ be the "ask price" of product $d$ at time $t$. A purchase of product $d$ at time $t$ would be made at this price.
* Let $c^d$ be the average cost of taking one unit of product $d$ to market. This includes production, storage and other fixed costs, delivery to the consumer, etc. In a first approximation we may assume that within the time horizon of the problem the costs are constant.

We can model the relationship between products demand and prices as
$$q^d_i = \mathscr M(\mathbf p_i, \Theta^d, \mathbf{\epsilon}^q_i) \tag{1}$$ where $\Theta^d$ is a list of parameter to be fitted, $\{\mathbf{\epsilon}^d_i \ \}_i$ are random unobserved errors, a norm (or size measure) of which we are set to minimize. The subindex $i$ is shorthand for $t_i$. Let $\mathscr M(\mathbf p_i, \hat\Theta^d, \mathbf{0})$ be the fitted value of $q^d$ at present time.

I am working in a dynamic market, but I can assume the relation (1) changes slowly, so transaction data can be use to update $\Theta^d$ slowly.

The demand for product $d$ depends on not only on the price $p^d$ but on all other prices, i.e.: there price on some products may affect the demand of other products: some products can substitute for others, some products are "traffic drivers," etc.

The problem is to "learn" (in the data science sence) the realtionship (1), i.e.: the current "state of the market" as it pertains to product demand, and use it to set prices that maximize expected revenue: $$\sum_d ( p^d - c^d)*\mathscr M(\mathbf p, \hat\Theta^d,\mathbf 0 ). \tag{2}$$

There are two models of demand in terms of price that are well represented in the pricing literature, namely, the linear model and the log-linear model. Both of them are amenable to be learnt dynamically with, for example, stochastic gradient descent. Are there oher simple well represented models?

It seems reasonable to assume (2) is a concave function of prices, in which case the maximization of can be treateed within the convex optimization context. In the case of linear models of demand, the concavity of (2) reduces to verifying the matrix of price coefficients in the models induces a semiposive definite quadratic function, which suggest that a good way of guranting that is to restrict model (1) to those that will render (2) concave. My problem involves over 10^5 products (possibly over 10^6) , so computational complexity of imposing the concavity condition becomes a consideration.

The log-linear model (log(demand) = linear function of log(prices) + remainder)) for demand results in models for which verication of (2) seems untractable.

$\mathbf{Questions}$

1) Are there flexible models one can use in (1) for which (2) can be guarantied to be concave, or for which concavity can be verified with complexity less than $O(D^3)$ ? Here $D$= number of producs. 2) Is fitting those models and solving the optimization problem (2) computationally feasible in a dynamic context?

$\mathbf{Comments}$

1) Any flexible model for (1) is acceptable. My aim is to use dynamic learning. Interpretability is not an issue. Distributions of the remainders is not an issue.

2) To keep in the dynamic context, (2) need not be optimize at once. Since the relation (1) is not stationary, it would be enough to control prices dynamically to drive revenue upwards. This may relaxed the computational complexity of updating prices.

3) There are no supply constraints. Supply may be assume to be infinite.

4) Model (1) is a simplification, there are other obvious predictors of demand to be included, such as seasonality, etc.