Stan has a vectorized $\Phi(x)$ (standard cumulative distribution function) but lacks a corresponding vectorized $\varphi(x)$ (standard normal density). You can't get this using std_normal_lpdf(), as it sums the log density values; I'm asking for something that returns a vectorized result.
One use case for a vectorized $\Phi(x)$ is in computing a quasi-hinge function based on $\Phi(x)$:
$h(x) = x \Phi(x) + \varphi(x)$.
This function has range $(0,\infty)$ with $h(x) \to 0$ as $x\to -\infty$, $h(x)/x \to 1$ as $x\to \infty$, and $h'(x) = \Phi(x)$.
Stan has a vectorized$\Phi(x)$ (standard cumulative distribution function) but lacks a corresponding vectorized $\varphi(x)$ (standard normal density). You can't get this using
std_normal_lpdf(), as it sums the log density values; I'm asking for something that returns a vectorized result.One use case for a vectorized$\Phi(x)$ is in computing a quasi-hinge function based on $\Phi(x)$ :
This function has range$(0,\infty)$ with $h(x) \to 0$ as $x\to -\infty$ , $h(x)/x \to 1$ as $x\to \infty$ , and $h'(x) = \Phi(x)$ .