Expected value with conditional inequality

streetd4wg

New member
Joined
Sep 13, 2020
Messages
1
Using the standard Cauchy distribution I am trying to compute E[√X | X ≥ 1] (I guess this is read "expected value of the square root of X given X is greater than or equal to 1") for a homework problem (we can use python/scipy). Intuitively, I think this value should be greater than 1 considering the square root of X is greater than 1 for X ≥ 1.
I am not sure if my intuition is incorrect or if I am doing something wrong to demonstrate this but the value I get from scipy using the code below is ~0.55.
The code I am using to get this is below

Python Code:
pdf = lambda x: 1 / (math.pi * (1 + x ** 2)) # standard Cauchy distribution continuous RV
class my_pdf(scipy.stats.rv_continuous):
def _pdf(self, x):
return 1 / (math.pi * (1 + x ** 2))

my_cv = my_pdf(name='my_pdf')
actual_expected_value = my_cv.expect(lambda t: math.sqrt(t), lb=1, ub=math.inf)
print(actual_expected_value) # gives ~0.55

Can someone help point me in the right direction? Am I doing something wrong with scipy or is my intuition incorrect? Thanks!
 
Top