# Estimating Conditional Expectations with Monte Carlo Simulation and Least Squares Regression

Estimating Conditional Expectations with Monte Carlo Simulation and Least Squares Regression

In this Demonstration we consider three random variables, and , which are uniformly distributed on the interval [0,1] and , where , , and are (user-specified) non-negative integers. The purpose is to compute the conditional expectation symbolically and by polynomial regression on data obtained from randomly generated sequences (, ). The display shows the graphs of the conditional expectation function (red) and an estimate (green), explicit formulas giving the exact value of the conditional expectation and its polynomial estimate, and the (square-integrable) error of the estimate, obtained by integrating the square of the difference between the true conditional expectation and the estimated one.

X

Y

W=

3

(a+bX+cY)

a

b

c

E(X|W)

x

w

L

2

Use the controls to choose the values of , , and and the degree of the polynomial to be used in the regression.

a

b

c