Charlottee
Charlottee

Reputation: 79

R How to find x if φ(x)=0.5?

x is normal distribution with mean=3 and standard deviation=2. Given φ(x)=0.5, how to find x?

I know this is dnorm(x,3,2)=0.5 in R, but I'm not sure how to find x using R.

Upvotes: 0

Views: 391

Answers (1)

ThomasIsCoding
ThomasIsCoding

Reputation: 101373

I guess what you want to solve is pnorm(x,3,2)=0.5, rather than dnorm(...), since the maximum of dnorm(x,m,v) is 1/(sqrt(2*pi)*v), mathematically, which is

> 1/(2*sqrt(2*pi))
[1] 0.1994711

if you have m = 3 and v = 2 in your specific case, and cannot reach 0.5. Otherwise, we would say dnorm(x,3,2) = 0.5 has no real solutions.


If that's true, then you should use qnorm(0.5,3,2) to solve x, which gives

> qnorm(0.5,3,2)
[1] 3

and we double check it

> pnorm(3,3,2)  
[1] 0.5

Upvotes: 2

Related Questions