I have this (differential) equation:
f(x)*x + F(x) = 1
where f(x) is a pdf and F(x) its corresponding cdf. Or similarly,
F'(x)*x + F(x) = 1
I can calculate x numerically, but I want an analytical solution. Perhaps there is a single analytical (exact and closed) solution in general (that would be great), although I only need it for the normal distribution.
* Added after first answer *
The equation comes from this one:
$$ argmin_x \{ x(F(x)-1) \} $$
I use the following code in R. It is not meant to be efficient. Once I clarify this problem, I will use a better numerical method (e.g. hill climbing if the function is convex or other methods).
optpred_bidloss_normcalc <- function(me, sd) { RESO <- 100000 MIN <- 0 # It cannot be negative MAX <- max(me, 0) + sd # This is an approximation to the maximum x <- rep(1,RESO) y <- rep(1,RESO) for(i in 1:RESO) { loc <- MIN + (MAX-MIN)*(i-1)/(RESO-1) x[i] <- loc y[i] <- loc * (pnorm(loc, mean= me, sd= sd) - 1) } imin <- which.min(y) sol <- x[imin] sol }
* Example *
> mymean <- 10 > mysd <- 0.5 > x <- optpred_bidloss_normcalc(mymean, mysd) > x [1] 9.00132 > x* dnorm(x,mean=mymean, sd=mysd) + pnorm(x, mean=mymean,sd=mysd) [1] 1.000015