[R] solving a complicated equation
Gabor Grothendieck
ggrothendieck at gmail.com
Mon Nov 7 00:18:16 CET 2005
Try this:
f <- function(x, a, b, p) a * exp(-x*x/2)+ b * pnorm(x, lower.tail = FALSE) - p
uniroot(f, lower = -3, upper = 3, a = 1, b = 1, p = 0.5)
On 11/6/05, Cunningham Kerry <kerryrekky at yahoo.com> wrote:
> I want to solve the following equation for x
>
> p=a*exp(-x^2/2)+b*P(Z>x)
>
> where p,a,b are known, Z is a standard normal
> variable. Clearly there is no analytic form for
> P(Z>x).
>
> I am wondering if any expert could direct one easy way
> on this. Thank you.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list