# Conditional expectation of values higher than a threshold

#### SeulContreTous

##### New Member
Hi there!

I'm having some hard time dealing with a question that hopefully will look trivial to someone here:

Considering a gaussian distributed random variable: x~N(m,v) and a arbitrarily selected threshold t; what is the expected value for this variable if only x>t are considered?

E(x|x>t)=?

Please note that I am not looking for the probability of x>t but the mean of x that fulfill the condition x>t.

This can be simulated in R:
m<-0
v<-1
x<-rnorm(100000,m,v)

mean(x[x>t])

I'm attaching the graph of the relationship obtained with m=0, v=1 and t varying from -5 to 5 that I hope will make things clearer.

Does someone know the analytic formula for this function? Can we compute it based on m and v and without having to simulate several values?

Many thanks!!!

#### Dason

##### Ambassador to the humans
You're essentially looking at the expected value of a truncated normal distribution. I'm too lazy to write out the expected value in latex so you can follow the link.