Skip to content

Feature request: vectorized phi() #3203

Open
@ksvanhorn

Description

@ksvanhorn

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)$.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions