Convert a pdf into a conditional pdf such that mean increases and std dev falls
Just apply an optimization to search for the X values that satisfy the criteria you're looking for. Here's a simple demo:

set.seed(123)
mu_x_true = 1e4
mu_y_true = 3.75
n = 1e2

x &lt;- rpois(n, mu_x_true)
y &lt;- rnorm(n, sqrt(mu_y_true))^2

plot(x, y)

# conditions:
# E[Y|X] &gt; E[Y]
# std(Y|x) &lt; std(Y)

mu_y_emp = mean(y)
sd_y_emp = sd(y)

objective &lt;- function(par, alpha=0.5){ 
    if (par[1]&gt;par[2]) par = rev(par)
    ix &lt;- which((par[1] &lt; x) &amp; (x &lt; par[2]))
    k &lt;- length(ix)
    if (k==0) return(1e12)
    mu_yx &lt;- mean(y[ix])
    sd_yx &lt;- sd(y[ix])

    alpha*(mu_y_emp - mu_yx) + (1-alpha)*(sd_yx - sd_y_emp)
}

init &lt;- mean(x) + c(-sd(x), sd(x))
test &lt;- optim(objective, par=init)

ix &lt;- which((par[1] &lt; x) &amp; (x &lt; par[2]))

mean(y[ix]) &gt; mean(y) 
# TRUE

sd(y) &gt; sd(y[ix])
# TRUE