Description
Hi Jonathan,
I would like to evaluate conditional expected value E(g_i | X_{~i})
, where g_i
is a component function (polynomial) which contains only X_i
terms and the conditional variables are all the other variables (except X_i
). The variables X~N(mu, cov)
are considered to be correlated, i.e. dist=cp.MvNormal().
When looking at your implementation of cp. E_cond() there is an assert which is activated when dist is stochastically dependent. I am wondering what needs to be done such that I can compute the cond. exp. value also with a stoch. dep. distribution.
My approach was to first modify your code of E_cond() such that I compute expected.E(unfrozen, dist)
(the last line of in the E_cond source code) numerically by sampling from dist and computing a mean of evaluated unfrozen polynomials. But I think this is not enough.
To elaborate a bit more, in my understanding, computing the expected value of a polynomial g_i
, where the conditional variables X_{~i}
are not present in the polynomial, will result in a constant number c
, i.e. c = E(g_i | X_{~i})
and variance of V(c) = 0
. But in case of the correlated variables, even if the conditional variables X_{~i}
are not present in the polynomial they still interact with the X_i
variables that are in g_i
and thus E(g_i | X_{~i})
will not be a constant, is this correct?