betaFeedback

WorksComputer Science

Learning to Price and Stock Under Contextual and Censored Demand

Abstract

To make optimal joint pricing and inventory control decisions is a critical challenge for modern retailers. In practice, retailers face changing market conditions where demands are influenced by various contextual factors, while simultaneously dealing with the difficulty of lost sales that obscure true demand information. However, existing approaches often fail to account for both contextual information and censored demand observations. We address this gap by presenting a framework where we model demand as a linear combination of basis functions with unknown coefficients, allowing for adaptive pricing and inventory decisions that respond to changing contexts. We propose an efficient algorithm to achieve regret bound O(KTlog⁡T)\mathcal{O}(K\sqrt{T}\log T) under concave revenue conditions and O(K2/3T2/3(log⁡T)1/2)\mathcal{O}(K^{2/3}T^{2/3}(\log T)^{1/2}) for the general case, with matching lower bounds confirming optimality. Extensive numerical experiments across diverse scenarios demonstrate our algorithm's effectiveness.

Introduction

In recent years, joint pricing and inventory control has gained significant attention from both academia and industry. Leading retailers increasingly leverage data science to drive innovation in pricing strategies, inventory management, and supply chain optimization. This growing interest is reflected in comprehensive surveys [8, 39, 29]. However, a critical gap remains: most existing models overlook the role of censored demand and contextual information, which are essential for adaptive decision-making. In this paper, we address this gap by studying the optimal joint pricing and inventory control strategy with lost sales that incorporates contextual information, aiming to bring theory closer to real-world applications.

In this paper, we study a joint pricing and inventory control problem with contextual information and lost sales over a finite horizon of TT periods. At the start of each period, the seller observes contextual information that influences customer demand. The demand function is modeled as a linear combination of KK basis functions with unknown coefficients, plus an independent random noise term. Using the observed context and an estimated demand function, the seller simultaneously sets the selling price and inventory level, with replenishment taking effect immediately. After making the decisions, only the censored demand, i.e., the minimum between actual demand and available inventory, is observed as unmet demand are lost. Leftover inventory carries over to the next period, incurring a linear holding cost, while unmet demand results in a linear lost penalty cost. The objective is to maximize profit, defined as sales revenue minus inventory holding and lost sales costs, across the TT-period horizon.

Our problem introduces several interconnected challenges that complicate both theoretical analysis and practical implementation. First, the presence of censored demand obstructs direct observation of true demand signals, necessitating the development of unbiased estimators for the demand function while mitigating inherent biases from incomplete data. Second, the inclusion of contextual factors result in the problem being dynamic, thus traditional optimization methods which lead to static policies become inapplicable. Both the pricing and inventory decisions must adapt to contextual information in order to achieve optimality. Finally, when applying our methodology to models beyond the combination of the basis functions, approximation errors arise due to structural mismatches between idealized model and real-world dynamics, demanding rigorous error quantification and robustness guarantees. Together, these challenges necessitate a novel integration of censored data correction, context-aware online optimization, stochastic inventory control, and error-bounded approximation techniques.

Our contributions can be summarized as followings:

  1. Context-Aware Pricing and Inventory Optimization. We propose a framework for joint pricing and inventory management (see Table 1) where decisions adapt to contextual information, with both pricing and inventory policies responding to changing contexts.

PaperContextCensored DemandUpper BoundLower BoundAssumptions
[Chen et al., 2019]NoNoT\sqrt{T}N/A—
[Chen et al., 2021]NoYesT12+νT^{\frac{1}{2}+\nu}N/Alog⁡T\sqrt{\log T}-differentiable, concave
[Chen et al., 2024]NoYesT\sqrt{T}N/ATwice-differentiable, concave
[Chen et al., 2024]NoYesT35T^{\frac{3}{5}}T35T^{\frac{3}{5}}Twice-differentiable
OursYesYesT23T^{\frac{2}{3}}T23T^{\frac{2}{3}}Differentiable
OursYesYesT\sqrt{T}N/ATwice-differentiable, concave

Table 1. Comparison of Regret Bounds under Joint Pricing and Inventory Control Problems

  1. Algorithmic Framework and Regret Analysis. We propose an easy-to-implement algorithm addressing censored demand, dynamic contexts, and stochastic inventory dynamics. Under concave revenue,

Note: The regrets listed above omit constant factors and poly(log⁡T)(\log T) terms. Here, ν=13ln⁡T+0.25ln⁡T\nu= \frac{1}{\sqrt{3\ln T}} + \frac{0.25}{\sqrt{\ln T}}.

our method achieves O~(KTlog⁡T)\tilde{O}(K\sqrt{T}\log T) regret, matching the lower bound. Without concavity, we derive O~(K2/3T1/2(log⁡T)1/2)\tilde{O}(K^{2/3}T^{1/2}(\log T)^{1/2}) regret and prove a lower bound Ω(T(m+1)/(2m+1))\Omega(T^{(m+1)/(2m+1)}) in Theorem 4.4 for mm-th differentiable revenue functions, establishing minimax optimality (see Table 1).

  1. Inventory Feasibility. To address infeasible target inventory levels from contextual information, we develop a queueing-theoretic method using stochastic recursion to bound regret from inventory mismatches, ensuring stable performance under stochasticity.

Dynamic pricing. Initial research focused on non-contextual dynamic pricing [5, 7]. Wang et al. [36] achieved O~(T(m+1)/(2m+1))\tilde{O}(T^{(m+1)/(2m+1)}) regret for mm-th smooth demand functions with matching lower bounds. Bu et al. [6] extended this to additive linear contextual effects, establishing instance-dependent bounds. Other models assume Bernoulli purchase decisions [22, 19, 12, 38, 27, 26, 16]. Related studies [27, 26, 16] share similar settings but differ in noise distribution assumptions, with regret bounds ranging from O~(d02T2/3)\tilde{O}(d_0^2T^{2/3}) to O~((d0T)(2m+1)/(4m−1))\tilde{O}((d_0T)^{(2m+1)/(4m-1)}) [26, 16]. Gong and Zhang [20] achieved O~(d01/3T2/3)\tilde{O}(d_0^{1/3}T^{2/3}) with minimax optimality.

Inventory control. Classical inventory models, such as the newsvendor model [30], assume i.i.d. demand and use SGD-based methods for optimization, extended to multi-product settings, delayed replenishment [40], and quantity constraints [32]. Lyu et al. [28] addressed SGD infeasibility using mini-batch strategies. Recent work incorporates demand characteristics [15], while SAA methods construct empirical distributions from demand samples [25].

Joint pricing and inventory control. Whitin [37] first introduced joint pricing and inventory control with full information. Subsequent work [4] used dynamic programming, while Qin et al. [31] proposed approximations with sample complexity analysis. In online learning settings, Chen et al. [9] considered data-driven models without historical data. Chen et al. [10] addressed censored demand using spline interpolation and sample average methods. Chen et al. [11] proposed ternary/binary search methods for convex/non-convex demand functions, establishing theoretical lower bounds. However, existing models ignore contextual information; once contexts are considered, optimal prices and inventory change over time, making prior algorithms inapplicable. We summarize comparisons in Table 1.

Contextual bandit. Our policy connects to bandit algorithms [23, 17, 1, 34, 3, 33], including linear [1] and generalized linear bandits [24, 13]. Recent work [18, 2, 17] achieved optimal regret bounds for general function classes with regression oracles.

Notations. Throughout the paper, we use the following notations. For any positive integer nn, we denote the set {1,2,…,n}\{1,2,\ldots,n\} as [n][n]. The cardinality of a set AA is denoted by ∣A∣|A|. We use I{E}\mathbb{I}_{\{E\}} to represent the indicator function of the event EE. Specifically, I{E}\mathbb{I}_{\{E\}} takes the value 1 if EE happens, and 0 otherwise. For norms, we utilize the notation ∥⋅∥p\|\cdot\|_p where 1≤p≤∞1 \le p \le\infty to denote the ℓp\ell_p norm. Throughout the analysis, the notation O~\tilde{O} is employed to hide the dependence on absolute constants and logarithmic terms. It allows us to focus on the dominant behavior of the quantities involved.

Basic Setting

Consider a company selling a single type of products over a time period of TT rounds. At the beginning of each round tt, the firm observes a context xtx_t drawn i.i.d. from an unknown distribution in a compact domain X\mathcal{X}. Using this context, the company determines a pricing ptp_t and inventory order-up-to decision yty_t. The demand is modeled as Dt=λ(xt,pt)+ϵtD_t = \lambda(x_t,p_t) + \epsilon_t, where λ(⋅,⋅)\lambda(\cdot,\cdot) is a deterministic function capturing the demand-context-price curve, and ϵt\epsilon_t is an i.i.d. noise random variable with mean 0. The distribution function and density function of ϵt\epsilon_t are denoted as FF and ff, respectively. The company has no prior knowledge of the function λ(⋅,⋅)\lambda(\cdot,\cdot) or the distribution FF, and it must make its pricing and inventory decisions sequentially, relying solely on historical data to maximize the TT period total profit.

Decision dynamics. Let ItI_t denote the inventory level before replenishment at the start of the round tt. An admissible policy is represented by {(pt,yt),t≥1}\{(p_t,y_t),t\ge1\}, where pt∈[pmin⁡,pmax⁡]p_t\in[p_{\min},p_{\max}] is the price, and yt≥Ity_t\ge I_t is the order-up-to inventory level. The decision (pt,yt)(p_t,y_t) depends only on the observable contexts and historical data prior to the round tt.

Given any admissible policy {(pt,yt),t≥1}\{(p_t,y_t),t\ge1\}, the sequence of events for each round tt is described as follows:

  1. At the beginning of each round tt, the firm observes the context xt∈X⊆Rdx_t\in\mathcal{X}\subseteq\mathbb{R}^d and the starting inventory level ItI_t.

  1. The firm decides to place an order to bring the inventory level up to yt≥Ity_t\ge I_t, and also sets the selling price pt∈[pmin⁡,pmax⁡]p_t\in[p_{\min},p_{\max}]. We assume that newly ordered items arrive instantly, meaning that the ordering lead time is zero.

  1. The demand DtD_t realizes and is satisfied up to the available inventory. Any unsatisfied demand is lost and unobservable. Therefore, the lost-sales quantity (Dt−yt)+(D_t-y_t)^+ is not observable, and the firm only observes the sales quantity (censored demand) ot=min⁡{Dt,yt}o_t=\min\{D_t,y_t\}, rather than the full realized DtD_t.

  1. At the end of round tt, the firm incurs a profit of

qt=ptmin⁡{Dt,yt}−b(Dt−yt)+−h(yt−Dt)+=ptDt−(b+pt)(Dt−yt)+−h(yt−Dt)+.(1)\begin{aligned} q_t=p_t\min\{D_t,y_t\}-b(D_t-y_t)^+-h(y_t-D_t)^+ \\ &=p_tD_t-(b+p_t)(D_t-y_t)^+-h(y_t-D_t)^+. \tag*{(1)} \end{aligned}

where hh and bb are the per-unit holding and lost-sales penalty costs, respectively.

  1. Products may be perishable, with an unknown perishability rate ρ∈[0,1]\rho\in[0,1], which impacts the inventory carried over to the next period. The state transition is given by

It+1=max⁡{ρ(yt−Dt),0}.I_{t+1}=\max\{\rho(y_t-D_t),0\}.

Full information benchmark. The firm’s goal is to maximize the TT-period expected total profit ∑t=1TE[qt]\sum_{t=1}^{T}\mathbb{E}[q_t], by constructing an admissible policy {(pt,yt),t≥1}\{(p_t,y_t),t\ge1\}. This is a fundamental model for joint pricing and inventory control, with potential applications in various realistic retail scenarios.

Assuming the demand curve λ(⋅,⋅)\lambda(\cdot,\cdot) and noise distribution FF are known, we define the myopic pricing and replenishment policy as a benchmark. This policy is represented as

(pt∗,yt∗)=arg⁡max⁡p,yQ(xt,p,y),(p_t^*,y_t^*)=\arg\max_{p,y}Q(x_t,p,y),

for t=1,…,Tt=1,\ldots,T, where

Q(x,p,y)=pEϵ[min⁡{λ(x,p)+ϵ,y}]−bEϵ[(λ(x,p)+ϵ−y)+]−hEϵ[(y−λ(x,p)−ϵ)+]=pλ(x,p)−(b+p)Eϵ[(λ(x,p)+ϵ−y)+]−hEϵ[(y−λ(x,p)−ϵ)+].\begin{aligned} Q(x,p,y)={}&p\mathbb{E}_{\epsilon}[\min\{\lambda(x,p)+\epsilon,y\}]\\ &-b\mathbb{E}_{\epsilon}[(\lambda(x,p)+\epsilon-y)^+]\\ &-h\mathbb{E}_{\epsilon}[(y-\lambda(x,p)-\epsilon)^+]\\ ={}&p\lambda(x,p)-(b+p)\mathbb{E}_{\epsilon}[(\lambda(x,p)+\epsilon-y)^+]\\ &-h\mathbb{E}_{\epsilon}[(y-\lambda(x,p)-\epsilon)^+]. \end{aligned}

The regret at time tt is defined as the loss in reward resulting from setting the price ptp_t and the inventory level yty_t compared to the optimal price and inventory level. The cumulative regret over the horizon of TT periods, denoted as R(T)R(T), is given by the expression:

R(T)=∑t=1T[Q(xt,pt∗,yt∗)−Q(xt,pt,yt)].R(T)=\sum_{t=1}^{T}[Q(x_t,p_t^*,y_t^*)-Q(x_t,p_t,y_t)].

To assess performance, we consider the expected cumulative regret E[R(T)]\mathbb{E}[R(T)], which accounts for the randomness in covariates and the potential randomness in the pricing policy.

Assumptions. We make the following assumptions, most of which are rather standard in the literature.

First, we consider the linear additive model as the demand function, which means that λ(x,p)\lambda(x,p) is a linear combination of the basis function.

Assumption 1. There exists a set of basis functions {λi(x,p)}i=1K\{\lambda_i(x,p)\}_{i=1}^{K} and a unique unknown parameter θ∗=(θ1∗,θ2∗,…,θK∗)T\theta^*=(\theta_1^*,\theta_2^*,\ldots,\theta_K^*)^\mathsf{T} such that λ(x,p)=∑i=1Kθi∗λi(x,p)\lambda(x,p)=\sum_{i=1}^{K}\theta_i^*\lambda_i(x,p).

This assumption includes many commonly used demand functions, such as [Cohen et al., 2020] [14]. Next, we introduce some basic assumptions on the revenue function.

Assumption 2. The revenue function Q(x,p,y)Q(x,p,y) is continuously differentiable with respect to xx, pp and yy.

The differentiability of QQ is a common assumption in the literature, as seen in works such as [Chen et al., 2019; Qin et al., 2022; Chen et al., 2024] [9, 31, 11]. For the dynamic pricing component, this assumption is particularly relevant, as it encompasses many practical demand functions, including those discussed in [Cohen et al., 2020; Wang et al., 2021b; Wang et al., 2021a] [14, 36, 35]. In inventory control, several papers, such as [Shi et al., 2016; Ding et al., 2021] [32, 15], adopt the newsvendor objective function, which is differentiable with respect to the inventory level yy. These properties are crucial for deriving closed-form solutions for the optimal inventory level y∗(x,p)y^*(x,p) given the context xx.

Proposition 1. The optimal inventory level enjoys the following structure: y∗(x,p)=λ(x,p)+z∗(p)y^*(x,p)=\lambda(x,p)+z^*(p), where z∗(p)=F−1(b+pb+p+h)z^*(p)=F^{-1}\left(\frac{b+p}{b+p+h}\right).

A context-free version of this result has appeared in [Ding et al., 2021; Chen et al., 2021; Chen et al., 2024] [15, 10, 11]. To extend this to contextual dynamic pricing, we follow the process outlined below. To obtain the optimal inventory level. We begin by noting that ∂Q∂y=b+p−(b+p+h)F(y−λ(x,p))\frac{\partial Q}{\partial y}=b+p-(b+p+h)F(y-\lambda(x,p)). The optimal order-up-to level thus is given by y∗(x,p)=λ(x,p)+z∗(p)y^*(x,p)=\lambda(x,p)+z^*(p), where z∗(p)z^*(p) satisfies z∗(p)=F−1(b+pb+p+h)z^*(p)=F^{-1}\left(\frac{b+p}{b+p+h}\right). Finally, we assume some basic properties of the distribution noise, which is rather standard in the literature.

Assumption 3. The random error ϵt\epsilon_t is bounded on the interval [ϵ‾,ϵ‾][\underline{\epsilon},\overline{\epsilon}], and there exist positive constants κ1\kappa_1 and κ2\kappa_2 such that for any p∈[pmin⁡,pmax⁡]p\in[p_{\min},p_{\max}] and ϵ0∈[F−1(b+pb+p+h)−κ1,F−1(b+pb+p+h)+κ1]\epsilon_0\in\left[F^{-1}\left(\frac{b+p}{b+p+h}\right)-\kappa_1,F^{-1}\left(\frac{b+p}{b+p+h}\right)+\kappa_1\right], we have f(ϵ0)≥κ2f(\epsilon_0)\ge\kappa_2.

The first assumption on ϵt\epsilon_t ensures the boundedness of the demand, which is a mild and common assumption in real-world applications [Chen et al., 2024] [11]. It is important to note that we do not require the decision maker to know the exact bounds of the noise or the demand function. The second assumption is satisfied by many continuous random variables, including uniform and truncated Gaussian distributions. And the third assumption needs the demand to be larger than a certain range of the noise ensuring robustness. In the following sections, we propose our algorithm and further discuss the approximation error of the demand function.

Algorithm Design

We present our algorithmic design and summarize the key challenges in this setting.

The first challenge is censored demand: lost sales are unobservable, so we cannot directly estimate the true demand parameter θ∗\theta^*. To mitigate this, we set the inventory level to scale with log⁡T\log T, improving demand observability without knowing the true demand upper bound.

The second challenge is the period-varying optimal inventory level due to changing contexts and perishable inventory constraints, which may make the ideal up-to-order level infeasible. We address this using a queue-based approach to control deviations from the recommended target inventory.

Recall from proposition 1 that the optimal inventory level is y∗(x,p)=λ(x,p)+z∗(p)y^*(x,p)=\lambda(x,p)+z^*(p), where z∗(p)z^*(p) is the safety stock level. The corresponding revenue function is

G(x,p)=max⁡yQ(x,p,y),G(x,p)=\max_y Q(x,p,y),

where xx is the context and pp is the price. The decision-maker estimates G(x,p)G(x,p) to determine the optimal price and then computes the corresponding target inventory.

Our method splits the time horizon into two phases: exploration and commitment. During exploration, we sample prices uniformly at random and set the inventory level high enough to fully observe demand, avoiding censoring and ensuring reliable feedback. The inventory level is tuned to balance learning accuracy and regret. We estimate the demand function using least-squares, leveraging the linear structure of the basis functions. Least-squares is chosen because its estimation error is negligible compared to the overall regret. Next, we estimate the total cost (including lost-sales and holding costs) by accurately estimating the optimal inventory function z(p)z(p) and the residual error. We approximate the demand distribution empirically and compute z(p)z(p) via the inverse CDF. With these estimates, we construct an empirical revenue function. Overall, our algorithm is simple, efficient, and practical for joint pricing and inventory control under censored demand and perishable constraints.

Regret Analysis

The main result of this section is that the proposed algorithm converges to the full information benchmark at a rate of O(KTlog⁡T)O(K\sqrt{T}\log T) under the strongly concave assumption, and at a rate of O(K2/3T2/3(log⁡T)1/2)O(K^{2/3}T^{2/3}(\log T)^{1/2}) without this assumption. We provide a detailed regret analysis in the following two subsections.

Strongly Concave Revenue Function

In this subsection, we present several additional assumptions that are standard in the literature (e.g., [10], [11], [4]). These assumptions are crucial for establishing the theoretical framework and ensuring the robustness of our model.

First, we assume that the full information optimal price pt∗p_t^* lies in the interior of the price interval [pmin⁡,pmax⁡][p_{\min},p_{\max}] for any time tt. This assumption is necessary to ensure that optimal pricing decisions can be made without hitting the boundaries of the price range, which could limit the effectiveness of pricing strategies.

Assumption 4. The full information optimal price pt∗p_t^* lies in the interior of [pmin⁡,pmax⁡][p_{\min},p_{\max}] for any tt.

Building on this, we further assume that the function G(x,p)G(x,p), which represents the relationship between the state variable xx and price pp, is strongly concave in pp for any given xx. This concavity condition is crucial, as it guarantees that the revenue generated from pricing is maximized, leading to unique optimal pricing strategies. Specifically, there exists a parameter κ3>0\kappa_3>0 such that the second derivative of GG with respect to pp is always less than or equal to −κ3-\kappa_3.

Assumption 5. G(x,p)G(x,p) is strongly concave in pp for any xx.

In other words, there exists a parameter κ3>0\kappa_{3} > 0 such that ∂p2G(x,p)≤−κ3\partial_{p}^{2}G(x,p) \le-\kappa_{3} for any xx.

Additionally, we require that the revenue function Q(x,p,y)Q(x,p,y) is twice continuously differentiable with respect to the variables xx, pp, and yy. This differentiability condition facilitates the application of optimization techniques and allows for smooth adjustments in response to changes in the underlying variables, ensuring a well-behaved revenue landscape.

Assumption 6. The revenue function Q(x,p,y)Q(x,p,y) is twice continuously differentiable with respect to pp, and yy and continuous with respect to xx.

Together, these assumptions create a robust foundation for analyzing the optimal pricing strategies within our model, ensuring both theoretical validity and practical applicability.

Now we are ready to give a sketch of proof of the Theorem 4.1: under strongly concave assumption. To give an upper bound on the regret, we first decompose the regret into the following terms:

R(T)≤E[∑t=1T0(Q(xt,pt∗,yt∗)−Q(xt,pt,yt∗))]+E[∑t=T0+1T(Q(xt,pt∗,yt∗)−Q(xt,pt,y^t))]+E[∑t=T0+1T∣Q(xt,pt,y^t)−Q(xt,pt,yt)∣].(2)\begin{aligned} \mathcal{R}(T) \le{} & \mathbb{E}\left[\sum_{t=1}^{T_{0}}\left(Q(x_t,p_t^*,y_t^*)-Q(x_t,p_t,y_t^*)\right)\right] \\ &+\mathbb{E}\left[\sum_{t=T_{0}+1}^{T}\left(Q(x_t,p_t^*,y_t^*)-Q(x_t,p_t,\hat{y}_t)\right)\right] \\ &+\mathbb{E}\left[\sum_{t=T_{0}+1}^{T}\left|Q(x_t,p_t,\hat{y}_t)-Q(x_t,p_t,y_t)\right|\right]. \tag*{(2)} \end{aligned}

where y^t=θ^Tϕ(xt,pt)+z^(pt)\hat{y}_t=\hat{\theta}^{T}\phi(x_t,p_t)+\hat{z}(p_t) is the recommended inventory level and yty_t is the truly implemented inventory level.

Now we consider two separate situations regarding the demand model: the first is the linear additive model, while the second is the linear additive model with an approximation bias. We provide upper bounds for the four terms respectively under each demand model.

Theorem 4.1. Under Assumption 3, Assumption 1, Assumption 4, Assumption 5, Assumption 6, there exists a constant C^\hat{C} such that the regret bound of our algorithm is R(T)≤C^KT12log⁡T\mathcal{R}(T) \le\hat{C}K T^{\frac{1}{2}}\log T.

In (2), the first term represents the regret during the exploration phase, which increases linearly with the total duration of the exploration. In the exploitation phase, we decompose the regret into two terms, where y^\hat{y} denotes the recommended inventory level and yty_t denotes the actual implemented inventory level. This decomposition is based on the fact that yt=max⁡{It,y^t}y_t=\max\{I_t,\hat{y}_t\}.

Using Taylor expansion, the second term in (2) can be bounded as follows:

Q(xt,pt∗,yt∗)−Q(xt,pt,y^t)≤C^2∥(pt,y^t)−(pt∗,yt∗)∥22.(3)Q(x_t,p_t^*,y_t^*)-Q(x_t,p_t,\hat{y}_t)\le\hat{C}_2\left\|(p_t,\hat{y}_t)-(p_t^*,y_t^*)\right\|_2^2. \tag*{(3)}

What remains is to bound the difference between the optimal price decision and the optimal inventory decision using the recommended strategy. By utilizing the strong concavity of the function GG, we turn the difference of the price into the maximum of the differential of the function GG:

∥pt∗−pt∥≤1κ3(max⁡p∈[pmin⁡,pmax⁡]∣∂pG−∂pG^∣(xt,p)).(4)\left\|p_t^*-p_t\right\|\le\frac{1}{\kappa_3}\left(\max_{p\in[p_{\min},p_{\max}]}\left|\partial_pG-\partial_p\hat{G}\right|(x_t,p)\right). \tag*{(4)}

Next, we need to bound the difference between the first derivative of the true function GG and the empirical estimate G^\hat{G}, which can be bounded by the estimation error.

Similarly, the difference in inventory levels yt∗−y^ty_t^*-\hat{y}_t can be bounded using the definition and the bound of the price decision pt∗−ptp_t^*-p_t. Thus, we have the following theorem:

Theorem 4.2. In the exploitation phase, there exists a constant C^\hat{C} such that

P(∥(pt∗,yt∗)−(pt,y^t)∥2≤C^KT−12(log⁡T0)12)>1−18T0−4.(5)\mathbb{P}\left(\left\|(p_t^*,y_t^*)-(p_t,\hat{y}_t)\right\|_2\le\hat{C}KT^{-\frac{1}{2}}(\log T_0)^{\frac{1}{2}}\right)>1-18T_0^{-4}. \tag*{(5)}

Finally, we need to provide an upper bound for the third term in (2).

In the case It≤y^tI_t\le\hat{y}_t, we have yt=y^ty_t=\hat{y}_t, which results in zero regret. Below, we only consider the case where It>y^tI_t>\hat{y}_t:

∣Q(xt,pt,y^t)−Q(xt,pt,yt)∣=∣hE[(y^t−Dt)+]+(b+pt)E[(Dt−y^t)+]−hE[(yt−Dt)+]−(b+pt)E[(Dt−yt)+]∣≤max⁡{h,b+pmax⁡}(yt−y^t).\begin{aligned} \left|Q(x_t,p_t,\hat{y}_t)-Q(x_t,p_t,y_t)\right| ={}&\left|h\mathbb{E}[(\hat{y}_t-D_t)^+]+(b+p_t)\mathbb{E}[(D_t-\hat{y}_t)^+] \right.\\ &\left.{}-h\mathbb{E}[(y_t-D_t)^+]-(b+p_t)\mathbb{E}[(D_t-y_t)^+]\right|\\ \le{}&\max\{h,b+p_{\max}\}(y_t-\hat{y}_t). \end{aligned}

Now we need to provide an upper bound on the difference yt−y^ty_t-\hat{y}_t. To do this, we establish the connection between the contextual inventory level and the waiting time process. Unlike the method in [10], which considers a non-contextual setting with the same optimal decision across all periods, we need to bound the difference in inventory levels yt−y^ty_t-\hat{y}_t dynamically.

To achieve this, we define the following two stochastic processes:

At+1=[At−Jt]+andBt+1=[Bt+ρqt−Jt]+(6)A_{t+1}=[A_t-J_t]^+ \quad\text{and}\quad B_{t+1}=\left[B_t+\frac{\rho_q}{\sqrt{t}}-J_t\right]^+ \tag*{(6)}

where

Jt=ϵt+ϵ−ϵˉ+θ^Tϕ(xt+1,pt+1)−λmax⁡C1K(log⁡T0)12T012.(7)J_t=\epsilon_t+\epsilon-\bar{\epsilon}+\hat{\theta}^{T}\phi(x_{t+1},p_{t+1})-\lambda_{\max}C_1K\frac{(\log T_0)^{\frac{1}{2}}}{T_0^{\frac{1}{2}}}. \tag*{(7)}

We have:

yt−y^t≤At≤Bty_t-\hat{y}_t\le A_t\le B_t

for t≥T0+1t\ge T_0+1.

In the above stochastic processes, AtA_t serves as an intermediate process. Additionally, BtB_t can be interpreted as the waiting time of the tt-th customer in the queuing system, where JtJ_t is the interarrival time between the ttth and (t+1)(t+1)-th customer, and ρq/t\rho_q/\sqrt{t} is the service time for the ttth customer. This idea is similar to the method presented in [21], which established a relationship between the amount of inventory exceeding the target level and the waiting time process in a GI/D/1 queue. However, they do not consider the impact of context and only need to bound the gradients to establish such a connection. In our analysis, since there are no gradients in the exploitation phase, we only need to exploit the estimation error during the exploration phase and the variability of features. Since this only involves the case where It>y^tI_t>\hat{y}_t, this method is also robust to perishable inventory levels.

Proposition 4.1. For any t≥T0+1t \ge T_0+1, yt−y^t≤Bty_t-\hat{y}_t \le B_t with probability at least 1−2T021-\frac{2}{T_0^2}, where BtB_t is defined in (6).

After providing a bound for the stochastic process defined above, we can upper bound the regret between the actual implemented inventory level and the recommended inventory level with the following proposition:

Proposition 4.2. There exists a constant C4C_4 such that the regret from not achieving inventory targets during the commitment phase is bounded by

E[∑t=T0+1T∣Q(xt,pt,y^t)−Q(xt,pt,yt)∣]≤C4T12\mathbb{E}\left[\sum_{t=T_0+1}^{T}\left|Q(x_t,p_t,\hat{y}_t)-Q(x_t,p_t,y_t)\right|\right] \le C_4T^{\frac{1}{2}}

which holds with probability at least 1−2T041-\frac{2}{T_0^4}.

Summing up all the inequalities above, we can obtain the bound mentioned in Theorem 4.1.

Non-concave Revenue Function

The non-concave revenue function has been studied in Chen et al. [11] in a non-contextual setting. They show that the penalty term related to inventory levels can destroy the concavity of the objective function, making the lost-sales model significantly more difficult to analyze compared to the backlogged case. To address this challenge, Chen et al. [11] propose a search-based method for identifying the optimal price under the assumption that the revenue function is twice differentiable, with Θ~(T3/5)\widetilde{\Theta}(T^{3/5}) minimax optimal regret bounds.

We extend their work in two key directions: we relax the assumption of second-order differentiability and generalize the problem to a contextual setting. In our case, the optimal prices vary over time due to changing contexts, and the revenue function GG may lack smoothness, making the approach in Chen et al. [11] inapplicable. Without assuming strong concavity of GG, we are unable to derive a precise upper bound on the difference between successive price decisions, as was done in the previous section. Instead, we adopt a greedy strategy to control this difference, which leads to a regret bound that is worse than the O(KTlog⁡T)O(K\sqrt{T}\log T) rate achieved under more favorable assumptions.

Theorem 4.3. With Assumption 2 and Assumption 1, there exists a constant C~\widetilde{C} such that the regret bound of our algorithm is R(T)≤C~KT~3/2(log⁡T)1/2\mathcal{R}(T) \le\widetilde{C}K\widetilde{T}^{3/2}(\log T)^{1/2}.

To prove Theorem 4.3, we decompose the regret into two parts:

  1. Bounding the revenue gap: G(xt,pt∗)−G(xt,pt)G(x_t,p_t^*)-G(x_t,p_t)

  2. Bounding the inventory regret: Q(xt,pt,yt∗)−Q(xt,pt,y^t)Q(x_t,p_t,y_t^*)-Q(x_t,p_t,\hat{y}_t)

For the first part, we use a decomposition of G(xt,pt∗)−G(xt,pt)G(x_t,p_t^*)-G(x_t,p_t) and apply the estimation error bound for G^(xt,p)\hat{G}(x_t,p), leading to:

G(xt,pt∗)−G(xt,pt)≤2∥G(x,p)−G^(x,p)∥∞≤C⋅KT0−1/2(log⁡T0)2.(8)\begin{aligned} G(x_t,p_t^*)-G(x_t,p_t) \le2\lVert G(x,p)-\hat{G}(x,p)\rVert_\infty\\ &\le C\cdot KT_0^{-1/2}(\log T_0)^2. \tag*{(8)} \end{aligned}

For the second part, we use an existing result in Proposition 4.2 to bound the inventory regret term. Finally, combining these bounds results yields the desired results.

Theorem 4.4. For any policy π\pi, there exists a non-contextual problem instance whose revenue function is mm-th differentiable, such that R(T)≥Ω(T(m+1)/(2m+1))\mathcal{R}(T)\ge\Omega(T^{(m+1)/(2m+1)}) for sufficiently large TT.

The instance construction is motivated by [35] . The construction of the noise distribution starts with a smooth function u(x)u(x), which is normalized to define a function B(x)B(x), leading to a density function f(x)f(x) supported on [−1,1][-1,1] with mean 00. Using this, a demand function λj(p)\lambda_j(p) is defined, which perturbs the base revenue function r0(p)r_0(p) using a small parameter η\eta and a bump function. The reward function Qj(p,y)Q_j(p,y) is shown to be mm-th differentiable, with bounds on the Hellinger distance between different environments. A lower bound on expected regret is derived using the pigeonhole principle, showing that for some interval i∗i^*, the regret for any policy is at least Ω(Tm+12m+1)\Omega(T^{\frac{m+1}{2m+1}}).

Combining the above upper and lower bounds, we conclude that Θ~(T23)\widetilde{\Theta}(T^{\frac{2}{3}}) is an achievable minimax optimal regret bounds only under the differentiability assumption.

Numerical Experiments

We conduct a numerical study to evaluate the empirical performance of our algorithms.

Test on parameters hh and bb

The experiments are based on a linear demand model:

dt=α+xtTβ+ϵt,d_t=\alpha+x_t^\mathsf{T}\beta+\epsilon_t,

where the parameter vector (α,β)∈R4(\alpha,\beta)\in\mathbb{R}^4 is sampled from a standard normal distribution and normalized to unit norm. The noise term ϵt\epsilon_t is drawn independently from the uniform distribution over [−1,1][-1,1]. Prices are constrained to the range pmin⁡=0.1p_{\min}=0.1 and pmax⁡=2p_{\max}=2.

For each experimental setting, we perform 50 independent runs. At each round, context vectors xtx_t are drawn from a standard normal distribution and normalized to unit length. We evaluate performance using relative regret, defined as R(T)T\frac{\mathcal{R}(T)}{T}, where R(T)\mathcal{R}(T) is the cumulative regret up to time TT. Results are reported for time horizons T∈{100,200,500,1000,2000,5000}T\in\{100,200,500,1000,2000,5000\}, including the mean and standard deviation across trials.

The numerical experiments in Figure 1 show that relative regret decreases as the time horizon TT increases. This trend holds across all three subplots with different parameter settings, indicating that the algorithm improves over time by leveraging more data for better decision-making and a balanced exploration-exploitation trade-off.

Joint Pricing and Inventory Control Algorithm with Censored Demand

Figure 1.

Relative regret over time horizon $T$ for different values of $h$ and $b$

Figure 1. Relative regret over time horizon TT for different values of hh and bb.

The error bars, representing standard deviation across trials, highlight increased variability at smaller TT, due to insufficient data for reliable convergence. As TT grows, the decreasing variability reflects improved stability. In Figure 2, the log-log plot shows a linear trend, suggesting a power-law relationship between regret and TT, which supports the algorithm’s robustness across different parameter settings.

Joint Pricing and Inventory Control Algorithm with Censored Demand

Figure 2.

Relative regret over time horizon $T$ for different values of $h$ and $b$ on a log-log scale

Figure 2. Relative regret over time horizon TT for different values of hh and bb (log-log scale).

Test on dimension KK

We investigate how the algorithm’s performance depends on the dimension of the basis functions, denoted by KK. We vary KK from 4 to 12 to assess its impact on regret. To ensure a fair comparison across different values of KK, we fix the total time horizon at T=1000T = 1000, and set the cost parameters as h=1h = 1 and b=1b = 1. All other experimental settings remain consistent with the base configuration described earlier.

Figure 3 shows the relative regret across different KK values. In summary, our results highlight key insights into the trade-offs involved in contextual joint pricing and inventory control:

Figure 3. Relative regret across different KK values with standard deviation error bars.

  • Regret Increases with Model Complexity: The relative regret increases consistently with KK, indicating that higher-dimensional models are more difficult to learn under a fixed time horizon. Intuitively, increasing KK enhances the expressive power of the model but requires more exploration.

  • Stable Performance Across Trials: Despite the increased complexity, the algorithm maintains controlled variance, with standard deviations remaining moderate across different values of KK, indicating robust and reliable performance.

Conclusion

This paper studies the joint pricing and inventory control problem under a linear additive model with contextual information and censored demand observations. We address the critical gap where existing approaches fail to account for both contextual factors and the difficulty of lost sales that obscure true demand information.

Our main contributions include: (1) a context-aware framework for joint pricing and inventory management where both pricing and inventory policies adapt to changing contexts; (2) an easy-to-implement algorithm that achieves optimal regret bounds of O(KTlog⁡T)O(K\sqrt{T\log T}) under concave revenue conditions and O(K2/3T2/3(log⁡T)1/2)O(K^{2/3}T^{2/3}(\log T)^{1/2}) for the general case, with matching lower bounds confirming minimax optimality; and (3) a queueing-theoretic method to handle infeasible target inventory levels, ensuring stable performance under stochasticity. Extensive numerical experiments demonstrate the algorithm’s effectiveness across diverse scenarios.

For future work, it would be valuable to investigate this problem under alternative modeling assumptions beyond the linear additive framework. It is also of interest to develop UCB-style analyses tailored to censored demand, which could offer principled exploration under partial observability.

Acknowledgments

This work was supported by the Theme-based Research Project T32-615/24-R and the General Research Fund 16500023 from the Hong Kong Research Grants Council.

References

References

  1. [1]Yasin Abbasi-Yadkori, Dávid Pál, and Csaba Szepesvári. Improved algorithms for linear stochastic bandits. Advances in neural information processing systems, 24, 2011.
  2. [2]Alekh Agarwal, Miroslav Dudík, Satyen Kale, John Langford, and Robert Schapire. Contextual bandit learning with predictable rewards. In Artificial Intelligence and Statistics, pages 19–26. PMLR, 2012.
  3. [3]Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 3(Nov):397–422, 2002.
  4. [4]Alain Bensoussan, Yangyang Xie, and Houmin Yan. Joint inventory-pricing optimization with general demands: An alternative approach for concavity preservation. Production and Operations Management, 28(9):2390–2404, 2019.DOI
  5. [5]Omar Besbes and Assaf Zeevi. On the (surprising) sufficiency of linear models for dynamic pricing with demand learning. Management Science, 61(4):723–739, 2015.
  6. [6]Jinzhi Bu, David Simchi-Levi, and Chonghuan Wang. Context-based dynamic pricing with partially linear demand model. Advances in Neural Information Processing Systems, 35:23780–23791, 2022.DOI
  7. [7]Nicolo Cesa-Bianchi, Tommaso Cesari, and Vianney Perchet. Dynamic pricing with finitely many unknown valuations. In Algorithmic Learning Theory, pages 247–273. PMLR, 2019.arxiv.org/abs/1807.03288
  8. [8]Xin Chen and David Simchi-Levi. Pricing and Inventory Management. Oxford University Press, United Kingdom, November 2012. Publisher Copyright: © Oxford University Press, 2013.
  9. [9]Boxiao Chen, Xiuli Chao, and Hyun-Soo Ahn. Coordinating pricing and inventory replenishment with nonparametric demand learning. Operations Research, 67(4):1035–1052, 2019.
  10. [10]Boxiao Chen, Xiuli Chao, and Cong Shi. Nonparametric learning algorithms for joint pricing and inventory control with lost sales and censored demand. Mathematics of Operations Research, 46(2):726–756, 2021.
  11. [11]Boxiao Chen, Yining Wang, and Yuan Zhou. Optimal policies for dynamic pricing and inventory control with nonparametric censored demands. Management Science, 70(5):3362–3380, 2024.
  12. [12]using cox proportional hazards model. In International Conference on Machine Learning, pages 5771–5786. PMLR, 2023.
  13. [13]Wei Chu, Lihong Li, Lev Reyzin, and Robert Schapire. Contextual bandits with linear payoff functions. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pages 208–214. JMLR Workshop and Conference Proceedings, 2011.
  14. [14]Maxime C Cohen, Ilan Lobel, and Renato Paes Leme. Feature-based dynamic pricing. Management Science, 66(11):4921–4943, 2020.
  15. [15]Jingying Ding, Woonghee Tim Huh, and Ying Rong. Feature-based nonparametric inventory control with censored demand. Social Science Research Network, 2021.
  16. [16]Jianqing Fan, Yongyi Guo, and Mengxin Yu. Policy optimization using semiparametric models for dynamic pricing. Journal of the American Statistical Association, 119(545):552–564, 2024.
  17. [17]Dylan Foster and Alexander Rakhlin. Beyond ucb: Optimal and efficient contextual bandits with regression oracles. In International Conference on Machine Learning, pages 3199–3210. PMLR, 2020.arxiv.org/abs/2002.04926
  18. [18]Dylan Foster, Alekh Agarwal, Miroslav Dudík, Haipeng Luo, and Robert Schapire. Practical contextual bandits with regression oracles. In International Conference on Machine Learning, pages 1539–1548. PMLR, 2018.arxiv.org/abs/1803.01088
  19. [19]Negin Golrezaei, Adel Javannmard, and Vahab Mirrokni. Dynamic incentive-aware learning: Robust pricing in contextual auctions. Advances in Neural Information Processing Systems, 32, 2019.arxiv.org/abs/2002.11137
  20. [20]Xueping Gong and Jiheng Zhang. Minimax optimality in contextual dynamic pricing with general valuation models. arXiv preprint arXiv:2406.17184, 2024.arxiv.org/abs/2406.17184
  21. [21]Woonghee Tim Huh and Paat Rusmevichientong. A nonparametric asymptotic analysis of inventory planning with censored demand. Mathematics of Operations Research, 34(1), 2009.DOI
  22. [22]Adel Javanmard and Hamid Nazarezadeh. Dynamic pricing in high-dimensions. Journal of Machine Learning Research, 20(9):1–49, 2019.
  23. [23]Tor Lattimore and Csaba Szepesvári. Bandit algorithms. Cambridge University Press, 2020.
  24. [24]Lihong Li, Yu Lu, and Dengyong Zhou. Provably optimal algorithms for generalized linear contextual bandits. In International Conference on Machine Learning, pages 2071–2080. PMLR, 2017.arxiv.org/abs/1703.00048
  25. [25]Meichun Lin, Woonghee Tim Huh, Harish Krishnan, and Joline Uichanco. Data-driven newsvendor problem: Performance of the sample average approximation. Operations Research, 70(4):1996–2012, 2022.
  26. [26][Luo et al., 2022] Yiyun Luo, Will Wei Sun, and Yufeng Liu. Contextual dynamic pricing with unknown noise: Explore-then-ucb strategy and improved regrets. Advances in Neural Information Processing Systems, 35:37445–37457, 2022.DOI
  27. [27][Luo et al., 2024] Yiyun Luo, Will Wei Sun, and Yufeng Liu. Distribution-free contextual dynamic pricing. Mathematics of Operations Research, 49(1):599–618, 2024.
  28. [28][Lyu et al., 2024] Jiameng Lyu, Jinxing Xie, Shilin Yuan, and Yuan Zhou. A minibatch stochastic gradient descent-based learning metapolicy for inventory systems with myopic optimal policy. Management Science, 2024.DOI
  29. [29][Petruzzi and Dada, 1999a] Nicholas C. Petruzzi and Maqbool Dada. Pricing and the news vendor problem: a review with extensions. Oper. Res., 47(2):183–194, February 1999.DOI
  30. [30][Petruzzi and Dada, 1999b] Nicholas C Petruzzi and Maqbool Dada. Pricing and the newsvendor problem: A review with extensions. Operations research, 47(2):183–194, 1999.DOI
  31. [31][Qin et al., 2022] Hanzhang Qin, David Simchi-Levi, and Li Wang. Data-driven approximation schemes for joint pricing and inventory control models. Management Science, 68(9):6591–6609, 2022.
  32. [32][Shi et al., 2016] Cong Shi, Weidong Chen, and Izak Duenyas. Nonparametric data-driven algorithms for multi-product inventory systems with censored demand. Operations Research, 64(2):362–370, 2016.
  33. [33][Simchi-Levi and Xu, 2021] David Simchi-Levi and Yun-zong Xu. Bypassing the monster: A faster and simpler optimal algorithm for contextual bandits under realizability. Mathematics of Operations Research, 2021.
  34. [34][Takemura et al., 2021] Kei Takemura, Shinji Ito, Daisuke Hatano, Hanna Sumita, Takuro Fukunaga, Naonori Kakimura, and Ken-ichi Kawarabayashi. A parameter-free algorithm for misspecified linear contextual bandits. In International Conference on Artificial Intelligence and Statistics, pages 3367–3375. PMLR, 2021.
  35. [35][Wang et al., 2021a] Hanzhao Wang, Kalyan Talluri, and Xiao-cheng Li. On dynamic pricing with covariates. arXiv preprint arXiv:2112.13254, 2021.arxiv.org/abs/2112.13254
  36. [36][Wang et al., 2021b] Yining Wang, Boxiao Chen, and David Simchi-Levi. Multimodal dynamic pricing. Management Science, 67(10):6136–6152, 2021.
  37. [37][Whitin, 1955] Thomson M Whitin. Inventory control and price theory. Management science, 2(1):61–68, 1955.
  38. [38][Xu and Wang, 2022] Jianyu Xu and Yu-Xiang Wang. Towards agnostic feature-based dynamic pricing: Linear policies vs linear valuation with unknown noise. In International Conference on Artificial Intelligence and Statistics, pages 9643–9662. PMLR, 2022.arxiv.org/abs/2201.11341
  39. [39][Yano and Gilbert, 2004] Candace A. Yano and Stephen M. Gilbert. Coordinated Pricing and Production/Procurement Decisions: A Review, pages 65–103. Springer US, Boston, MA, 2004.DOI
  40. [40][Zhang et al., 2020] Huanan Zhang, Xiuli Chao, and Cong Shi. Closing the gap: A learning algorithm for lost-sales inventory systems with lead times. Management Science, 66(5):1962–1980, 2020.DOI

Paper details

vlnc:W_j8kmgwse
Version
v1 · latest
Published
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents