##
from scipy.stats import norm
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
p=0.7
e1=np.random.normal(loc=0,scale=1,size=100)
e2=np.random.normal(loc=0,scale=1,size=100)
x1=e1
x2=p*e1+(1-p**2)**0.5*e2
res=pd.DataFrame()
res['x1']=x1
res['x2']=x2
print(res['x1'].corr(res['x2']))
plt.plot(x1)
plt.plot(x2)
plt.show()