This question arises from economic research attempting to model and estimate demand curves relating the quantity consumed $Q$ of goods to their price $P$. Assume $P > 0$, $Q \ge 0$, and as $P$ increases, $Q$ smoothly decreases when $Q > 0$ and, if it reaches $0$, remains at $0$ for all higher $P$. It is desired to express $Q$ as a function of $P$, the function being differentiable with respect to its parameters over the full range of $P$, and ideally linear in its parameters (to facilitate estimation by regression).
When $P$ is sufficiently high it is expected that $Q$ will either be $0$ or very close to $0$. There seem to be three cases:
The curve is asymptotic to the $P$ axis. This is straightforward, e.g. $Y = \dfrac{b}{P}$ or $\ln Y = a – bP$ are differentiable with respect to the parameters $a$, $b$.
There is some value $k$ of $P$ such that $Q = 0$ when $P \ge k$ and $Q > 0$ when $P < k$, and the curve is smooth at $k$.
As for 2 above, but kinked at $k$.
On the assumption that $k$ is unknown and must be considered one of the parameters, is there a way to model cases 2 and/or 3 with functions which are differentiable with respect to their parameters?
For case 2, I considered the function:
$Y = b(k - P)^2$ if $P < k$ and $Y = 0$ if $P \ge k$
However this does not work: it’s differentiable with respect to $b$ but not with respect to $k$.