diff --git a/is/ub7/is7.pdf b/is/ub7/is7.pdf index 5812b16..c2f1820 100644 --- a/is/ub7/is7.pdf +++ b/is/ub7/is7.pdf Binary files differ diff --git a/is/ub7/is7.tex b/is/ub7/is7.tex index 49305ec..81f9e0b 100644 --- a/is/ub7/is7.tex +++ b/is/ub7/is7.tex @@ -74,8 +74,6 @@ \textbf{Exercise \arabic{n}: #1} (#2 Points)\\} - - \begin{document} %\header{BlattNr}{Tutor}{Abgabedatum}{Vorlesungsname}{Namen}{Semester}{Anzahl Aufgaben} \header{7}{}{2015-06-25}{Intelligent Systems I}{\textit{Maximus Mutschler}\\ \textit{Jan-Peter Hohloch} @@ -97,14 +95,19 @@ \draw (Y) -- (W); \draw (Z) -- (W); \end{tikzpicture} - \item %TODO + \item \includegraphics[width=.8\textwidth]{xw.png} \end{enumerate} \Aufgabe{Causal effects}{60} \begin{enumerate}[(a)] - \item TODO%TODO plot + \item see above \item Setting $\alpha$ to $0$ makes Z independent of X.\\ Z is just random noise ($N_z$), so it is independent of X\qed - \item %TODO + \item \begin{align*} + \frac{d}{dx}\mathds{E}\left(W|do\ X=x\right)&=-4\frac{d\mathds{E}(V|do\ X=x)}{dx}+0.5\frac{d\mathds{E}(Y|do\ X=x)}{dx}+2\frac{d\mathds{E}(Z|do\ X=x)}{dx}\\ + &=0.5\cdot\left(-1\right)+2\cdot\alpha\\ + &=2\alpha -0.5 + \end{align*} + This is the slope of $W(x)$, which is only depending on $\alpha$. \end{enumerate} \end{document} diff --git a/is/ub7/plotting.py b/is/ub7/plotting.py new file mode 100755 index 0000000..2a79c70 --- /dev/null +++ b/is/ub7/plotting.py @@ -0,0 +1,40 @@ +#!/usr/bin/python3 +import numpy as np +import random as rand +import matplotlib.pyplot as plt + +n=1000 +alpha=np.arange(-2,2,0.1) + +V=[] +W=[] +X=[] +Y=[] +Z=[] + +for i in range(n): + V.append(rand.gauss(0,1)) + X.append(3*V[i]+rand.gauss(0,1)) + Y.append(-X[i]+rand.gauss(0,1)) + Z.append(-alpha[0]*X[i]+rand.gauss(0,1)) + W.append(-4*V[i]+0.5*Y[i]+2*Z[i]+rand.gauss(0,1)) + +plt.plot(X,W,'x') +#plt.show() + + +#for a in alpha: +V=[] +W=[] +X=[] +Y=[] +Z=[] +for i in range(n): + V.append(rand.gauss(0,1)) + X.append(3) + Y.append(-X[i]+rand.gauss(0,1)) + Z.append(-alpha[0]*X[i]+rand.gauss(0,1)) + W.append(-4*V[i]+0.5*Y[i]+2*Z[i]+rand.gauss(0,1)) +plt.plot(X,W,'x') + +plt.show() diff --git a/is/ub7/xw.png b/is/ub7/xw.png new file mode 100644 index 0000000..8dee372 --- /dev/null +++ b/is/ub7/xw.png Binary files differ