Skip to content

Continuous Treatment Models: Reduction to Linear Problem with Quadratic Constraint

This document assumes (and uses) the Continuous Treatment model setup, it's notation, etc. This pages sets up a problem that we can analytically solve, which we then use to demonstrate how to interact with the core components of the framework provided by causalprog. The corresponding notebook can be found here.

To that end, we will set the following:

\[\begin{align*} \sigma_{czl} = \frac{1}{2}\mathbb{I}_{d_z}, \quad \mathcal{D}_{eval} = \left\{ (\tilde{x}, \tilde{z}, \tilde{l} ) \right\}, \quad g(x, z, l) = -x \mathbb{I}_{d_z}, \quad \hat{r}(x, z, l) = 0, \quad f_Y(u_y, x, l) = \frac{\theta_Y}{l}(u_y - x)^2, \end{align*}\]

where \(\mathbb{I}_{d_z} = \frac{1}{\sqrt{d_z}}(1, 1, 1, ...)^{\top}\in\mathbb{R}^{d_Z}\) and \((\tilde{x}, \tilde{z}, \tilde{l} )\) is some chosen evaluation point (of which, only \(\tilde{x}\) will turn out to be relevant).

Note that this effectively forces us to pick constant functions for \(f_r\) (constant value \(\infty\)) and \(f_m\) (constant value 0), and thus also gives us \(\theta_m\) and \(\theta_r\) independent problems. As we will shortly see, the choice for \(f_{\pi}\) will also be irrelevant due to the nature of the problem we are getting up, so for argument's sake it can just map to the constant 1-vector (and the problem is independent of \(\theta_{\pi}\) too).

Let us also define \(\alpha(x) = \frac{3}{4}(1 + 3x^2) > 0\), which is a constant with respect to the parameters of the problem \(\theta\). We can also immediately deduce that

\[\begin{align*} m_y = \sigma_{czl}^{\top}g(x, z, l) = -\frac{x}{2}, \quad v_y = \frac{3}{4}. \end{align*}\]

We can then make the following simplifications to the forms of the regression function, learn initialiser, and causal responses:

\[\begin{align*} r(x, z, l) & = \int f_Y(u_y, x, l) \sum_{c}\pi_{ul}(c)p_N(u_y; m_y, v_y) \ \mathrm{d}u_y = \int\frac{\theta_Y}{l}(u_y - x)^2 \sum_{c}\pi_{ul}(c)p_N(u_y; -\frac{x}{2}, \frac{3}{4}) \ \mathrm{d} u_y \\ & = \int\frac{\theta_Y}{l}(u_y - x)^2 p_N(u_y; -\frac{x}{2}, \frac{3}{4}) \ \mathrm{d} u_y = \frac{\theta_Y}{l}\mathbb{E}\left[(U - x)^2 \ | \ U\sim\mathcal{N}\left(-\frac{x}{2}, \frac{3}{4}\right)\right] \\ & = \frac{\theta_Y}{l}\left(\frac{3}{4} + \left(\frac{-x}{2}\right)^2 - 2x\left(-\frac{x}{2}\right) + x^2\right) = \frac{\theta_Y \alpha(x)}{l}, \\ B(\theta) & = \frac{1}{n_{eval}}\sum_{\mathcal{D}_{eval}}\left(\hat{r}_i - r(x^{(i)}, z^{(i)}, l^{(i)}) \right)^2 = \frac{\theta_Y^2 \alpha(\tilde{x})^2}{\tilde{l}^2}, \\ d(x, l) & = \int f_Y(u_y, x, l)p_N(u_y; 0, 1) \ \mathrm{d}u_y = \frac{\theta_Y}{l}(1 + x^2). \end{align*}\]

This means that we have \(\theta^{\star} = \left\{ \theta_Y = 0 \right\}\), since \(B(\theta^{\star}) = 0\). Note that we have used the fact that \(\sum_{c}\pi_{ul}(c) = 1\), since we now have that everything else in the integrand is \(c\)-independent.

Therefore, given \(\delta^2 := \epsilon > 0\), our problem

\[\begin{align*} \mathrm{min} / \mathrm{max}_{\theta} d(x, l; \theta) & \quad\text{ subject to }\quad B(\theta) \leq B(\theta^{\star}) + \epsilon, \end{align*}\]

reduces to

\[\begin{align*} \mathrm{min} / \mathrm{max}_{\theta} \frac{\theta_Y}{l}(1 + x^2) & \quad\text{ subject to }\quad \frac{\theta_Y^2 \alpha(\tilde{x})^2}{\tilde{l}^2} \leq \delta^2. \end{align*}\]

Furthermore, the constraint is now a simple quadratic in \(\theta_Y\) which we can solve for, giving

\[\begin{align*} -\frac{\delta \tilde{l}}{\alpha(\tilde{x})} \leq \theta_Y \leq \frac{\delta \tilde{l}}{\alpha(\tilde{x})}, \end{align*}\]

which then lets us immediately read off the solution to the maximisation and minimisation problem:

\[\begin{align*} \text{max: attained at } \theta_Y = \frac{\delta \tilde{l}}{\alpha(\tilde{x})}, & \quad\text{with objective value } \quad \frac{\delta\tilde{l}}{l}\frac{1 + x^2}{\alpha(\tilde{x})}, \\ \text{min: attained at } \theta_Y = -\frac{\delta l}{\alpha(\tilde{x})}, & \quad\text{with objective value } \quad -\frac{\delta\tilde{l}}{l}\frac{1 + x^2}{\alpha(\tilde{x})}. \\ \end{align*}\]

Ergo, for given choices of \(x\), \(\tilde{x}\), \(\tilde{l}\), and \(\delta\), we now have an analytic solution that we can compare against.

Note that if we were to solve this problem by direct Lagrangian methods, we would construct

\[\begin{align*} \mathcal{L}(\theta, \lambda) &= \frac{\theta_Y}{l}(1+x^2) - \lambda \max(\frac{\theta_Y^2 \alpha(\tilde{x})^2}{\tilde{l}^2}, 0), \end{align*}\]

and shortly deduce that

\[\begin{align*} \nabla\mathcal{L}(\theta, \lambda) = 0, & \Leftrightarrow \theta_Y = \pm\frac{\delta\tilde{l}}{\alpha(\tilde{x})}, \quad \lambda = \pm \frac{\tilde{l}}{2l} \frac{1+x^2}{\delta \alpha(\tilde{x})}, \\ \text{with} \ d(x, l; \theta) &= \pm\frac{\delta\tilde{l}}{l}\frac{1 + x^2}{\alpha(\tilde{x})}. \end{align*}\]