Some simulated data, borrowed from this post.

Check if the variables behave as expected

Letâ€™s look at the true model.

Estimate using OLS.

Now using instrumental variables.

Now using the `lm`

function.

Now we can do the same using a neural network

Compare output.

Compare estimates.

Now redo using a non-linearity