Coming up with a better estimator for this quantity I have data from the following generative process:
$$
Z \sim F(z)\\
p = g(Z)\\
X \sim \text{Bernoulli}(p)
$$
Where $F(z)$ is an unknown distribution on $[-10^5, 10^5] \cap \mathbb{Z}$, and $g$ is an unknown monotonically increasing function. $X$ and $Z$ are observable, and $p$ is not.
I would like to estimate $P\left(X = 1 \vert Z = 0\right)$. The strategy of discarding all samples with $Z \neq 0$ is not practical due to the size of the support of $F$.
Ordinarily, I believe this would be the best you can do, but since $g$ is monotone it seems that there should be some way of incorporating the samples with $Z > 0$ and $Z < 0$. Is there some way to do so?

I think you want isotonic regression, which would consistently estimate $g(0)$ even if $Z$ was sampled from a continuous distribution (though only at $n^{-1/3}$, not $n^{-1/2}$ rate). There's a fast algorithm ('pool adjacent violators') and quite a lot of theory.
