Quick question: Using conditional expectation as a scalar.

121 Views Asked by At

Following on from this question: Quick Question: using expectation as a scalar

Given Random Variables: $X_i \underset{iid}{\sim} z$ forming a random sample of z where z is some >distribution and two given functions f and g.

lets define $\mathbb{E}_{g}[f(X)]=\int_{-\infty}^{\infty} f(X)g(X)~dx$ as the weighted expectation of f wrt to g.

From my understanding this is a number... it has a value and is not a "random variable" (even though i know constants are technically random variables with constant value)...

so if we were to calculate for example: $$Var[h(X)] = \sum\limits_{1}^{n}Var_{g}[\mathbb{E}_{g}[f(X_i)]w(X_i)]$$ In this instance, would it be correct to consider the expectation as if it's acting as a scalar (since it's value is constant for each defined observation) and so we could rewrite this as $$\sum\limits_{1}^{n}\mathbb{E}_{g}[f(X_i)]Var_{g}[w(X_i)]$$ where the $Var_g$ is defined analogously to $\mathbb{E}_{g}$

I have learnt that Conditional expectation may not act in the same way.

Consider a similar situation: Given Random Variables: $Y_i,X_i \underset{iid}{\sim} z$ forming a random sample of z where z is some distribution and two given functions f and g.

lets define $\mathbb{E}_{g}[f(X)]=\int_{-\infty}^{\infty} f(X)g(X)~dx$ as the weighted expectation of f wrt to g.

From my understanding then: $$\mathbb{E}_{g}[f(X,Y)|X] = \int\limits_{-\infty}^{\infty}f(X,Y)g_{Y|X}(Y|X)dy$$

where as we would generally consider: $$\mathbb{E}_{g}[f(X,Y)] = \iint\limits_{-\infty}^{\infty}f(X,Y)g(X,Y)dxdy$$

Now, I appreciate that my definition of the weighted conditional expectation may be wrong and so i'm prepared for that.

Now from my understanding: $$\mathbb{E}_{g}[f(X,Y)|X] = \int\limits_{-\infty}^{\infty}f(X,Y)g_{Y|X}(Y|X)dy$$ is constant in X (Since the observation is provided) and once the integral is computed this should become a number yes? so can we use this as a scalar in the following situation?

$$\begin{align*}Var[h(X,Y)] &= \sum\limits_{1}^{n}Var_{g}[\mathbb{E}_{g}[f(X_i,Y_i)|X_i]w(X_i)]\\ &= \sum\limits_{1}^{n}\mathbb{E}_{g}[f(X_i,Y_i)|X_i]^2Var_{g}[w(X_i)] \end{align*}$$

if not. then if we were to use the definition of conditional probability and substitute for $g_{Y|X}(Y|X) = \frac{g(X,Y)}{g_X(X)}$ like so:

$$\begin{align*}Var[h(X,Y)] &= \sum\limits_{1}^{n}Var_{g}[\mathbb{E}_{g}[f(X_i,Y_i)|X_i]w(X_i)]\\ &= \sum\limits_{1}^{n}\mathbb{E}_{g}[f(X_i,Y_i)]^2Var_{g}[\frac{w(X_i)}{g_{X}(X_i)}] \end{align*}$$

I believe at the very least, this would be valid. Thank you.