# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import numpy as np
import csv

size = 1000
np.random.seed(123)
x1 = np.random.uniform(size=size)
#f1 = np.random.laplace(size=size)
#f2 = np.random.laplace(size=size)
f1 = np.random.uniform(size=size)
f2 = np.random.uniform(size=size)
x2 = 0.4*x1 + 0.8*f1 + np.random.uniform(size=size)
x3 = 0.3*x2 + 0.7*f1 + 0.7*f2 + np.random.uniform(size=size)
x4 = 0.2*x3 + 0.8*f2 + np.random.uniform(size=size)
x5 = 0.5*x3 + 0.5*x4 + np.random.uniform(size=size)
x6 = 0.6*x5 + np.random.uniform(size=size)

xs = np.array([x1,x2,x3,x4,x5,x6,f1,f2]).T
X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,x6,f1,f2]).T,columns=['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'f1', 'f2'])
X.head()
X.to_csv('LiNGAM_latest_1000.csv', index=False)


# +
import pandas as pd
import numpy as np
import csv

size = 1000
np.random.seed(123)
x3 = np.random.uniform(size=size)
x1 = 1.4*x3 + np.random.uniform(size=size)
x2 = -0.8*x1 + 0.5*x3+ np.random.uniform(size=size)

#xs = np.array([x1,x2,x3]).T
X = pd.DataFrame(np.array([x1, x2, x3]).T,columns=['x1', 'x2', 'x3'])
X.head()
X.to_csv('LiNGAM_test_1000.csv', index=False)

# +
import numpy as np
import csv
import pandas as pd

size = 1000
np.random.seed(123)
x1 = np.random.uniform(size=size)
#f1 = np.random.laplace(size=size)
#f2 = np.random.laplace(size=size)
f1 = np.random.uniform(size=size)
f2 = np.random.uniform(size=size)
x2 = 0.4*x1 + 0.8*f1 + np.random.uniform(size=size)
x3 = 0.3*x2 + 0.7*f1 + 0.7*f2 + np.random.uniform(size=size)
x4 = 0.2*x3 + 0.8*f2 + np.random.uniform(size=size)
x5 = 0.5*x3 + 0.5*x4 + np.random.uniform(size=size)
x6 = 0.6*x5 + np.random.uniform(size=size)

np.random.seed(456)
x7 = 0.5*x6 + np.random.uniform(size=size)
#f3 = np.random.laplace(size=size)
#f4 = np.random.laplace(size=size)
f3 = np.random.uniform(size=size)
f4 = np.random.uniform(size=size)
x8 = 0.4*x7 + 0.8*f3 + np.random.uniform(size=size)
x9 = 0.3*x8 + 0.7*f3 + 0.7*f4 + np.random.uniform(size=size)
x10 = 0.2*x9 + 0.8*f4 + np.random.uniform(size=size)
x11 = 0.5*x9 + 0.5*x10 + np.random.uniform(size=size)
x12 = 0.6*x11 + np.random.uniform(size=size)

xs = np.array([x1,x2,x3,x4,x5,x6,f1,f2]).T
X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,x6,f1,f2,x7, x8, x9,x10,x11,x12,f3,f4]).
                 T,columns=['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'f1', 'f2','x7', 'x8', 'x9', 'x10', 'x11', 'x12', 'f3', 'f4'])
X.head()
X.to_csv('LiNGAM_latest2_1000.csv', index=False)

#X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,x6,f1,f2]).T,columns=['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'f1', 'f2'])
#X.head()
#X.to_csv('LiNGAM_latest2.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 1000
np.random.seed(123)
x1 = np.random.uniform(size=size)
#f1 = np.random.laplace(size=size)
#f2 = np.random.laplace(size=size)
f1 = np.random.uniform(size=size)
f2 = np.random.uniform(size=size)
x2 = -0.7*x1 + 1.2*f1 + np.random.uniform(size=size)
x3 = 0.5*x2 + f2 + np.random.uniform(size=size)
x4 = -0.5*x3 + 0.8*f1 + 1.2*f2 + np.random.uniform(size=size)
x5 = 1.2*x1 - 0.8*x4 + np.random.uniform(size=size)

xs = np.array([x1,x2,x3,x4,x5,f1,f2]).T

X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,f1,f2]).T,columns=["x1", "x2", "x3", "x4", "x5", "f1", "f2"])
X.head()
X.to_csv('LiNGAM_latest3_1000.csv', index=False)

# +
import numpy as np
import csv
import pandas as pd

size = 1000
np.random.seed(123)
x1 = np.random.uniform(size=size)
#f1 = np.random.laplace(size=size)
#f2 = np.random.laplace(size=size)
f1 = np.random.uniform(size=size)
f2 = np.random.uniform(size=size)
x2 = 0.4*x1 + 0.8*f1 + np.random.uniform(size=size)
x3 = 0.3*x2 + 0.7*f1 + 0.7*f2 + np.random.uniform(size=size)
x4 = 0.2*x3 + 0.8*f2 + np.random.uniform(size=size)
x5 = 0.5*x3 + 0.5*x4 + np.random.uniform(size=size)
x6 = 0.6*x5 + np.random.uniform(size=size)

np.random.seed(456)
x7 = 0.5*x6 + np.random.uniform(size=size)
#f3 = np.random.laplace(size=size)
#f4 = np.random.laplace(size=size)
f3 = np.random.uniform(size=size)
f4 = np.random.uniform(size=size)
x8 = 0.4*x7 + 0.8*f3 + np.random.uniform(size=size)
x9 = 0.3*x8 + 0.7*f3 + 0.7*f4 + np.random.uniform(size=size)
x10 = 0.2*x9 + 0.8*f4 + np.random.uniform(size=size)
x11 = 0.5*x9 + 0.5*x10 + np.random.uniform(size=size)
x12 = 0.6*x11 + np.random.uniform(size=size)

np.random.seed(789)
x13 = 0.5*x12 + np.random.uniform(size=size)
#f5 = np.random.laplace(size=size)
#f6 = np.random.laplace(size=size)
f5 = np.random.uniform(size=size)
f6 = np.random.uniform(size=size)
x14 = 0.4*x13 + 0.8*f5 + np.random.uniform(size=size)
x15 = 0.3*x14 + 0.7*f5 + 0.7*f6 + np.random.uniform(size=size)
x16 = 0.2*x15 + 0.8*f6 + np.random.uniform(size=size)
x17 = 0.5*x15 + 0.5*x16 + np.random.uniform(size=size)
x18 = 0.6*x17 + np.random.uniform(size=size)

X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,x6,f1,f2,x7, x8, x9,x10,x11,x12,f3,f4,
                          x13,x14,x15,x16,x17,x18,f5,f6]).
                 T,columns=['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'f1', 'f2','x7', 'x8', 'x9', 'x10', 'x11', 'x12', 'f3', 'f4',
                           'x13','x14','x15','x16','x17','x18','f5','f6'])
X.head()
X.to_csv('LiNGAM_latest4_1000.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 10000
np.random.seed(123)
f1 = np.random.uniform(size=size)
f10 = np.random.uniform(size=size)

np.random.seed(456)
f2 = 0.3*f1+np.random.uniform(size=size)
f3 = 0.3*f2+np.random.uniform(size=size)
f4 = 0.3*f3+np.random.uniform(size=size)
f5 = 0.3*f4+np.random.uniform(size=size)
f9 = -0.3*f10+np.random.uniform(size=size)
f8 = -0.3*f9+np.random.uniform(size=size)
f7 = -0.3*f8+np.random.uniform(size=size)
f6 = -0.3*f7+np.random.uniform(size=size)

np.random.seed(789)
x1 = 0.4*f1 + 0.6*f6 + 0.1*f5 + np.random.uniform(size=size)
x2 = 0.2*x1 + 0.5*f1 + 0.5*f2 + 0.6*f7+ 0.1*f8  + np.random.uniform(size=size)
x3 = 0.2*x2 + 0.5*f2 + 0.5*f4 + 0.6*f8+ 0.1*f9  + np.random.uniform(size=size)
x4 = 0.2*x3 + 0.5*f3 + 0.5*f5 + 0.6*f9+ 0.1*f10  + np.random.uniform(size=size)
x5 = 0.2*x4 + 0.5*f4 + 0.5*f5 + 0.1*f10  + np.random.uniform(size=size)



X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10]).T,
                 columns=['x1', 'x2', 'x3', 'x4', 'x5', 'f1', 'f2','f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10'])
X.head()
X.to_csv('LiNGAM_latest5.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 10000
np.random.seed(123)
f1 = np.random.uniform(size=size)
f10 = np.random.uniform(size=size)

np.random.seed(456)
f2 = 0.3*f1+np.random.uniform(size=size)
f3 = 0.3*f2+np.random.uniform(size=size)
f4 = 0.3*f3+np.random.uniform(size=size)
f5 = 0.3*f4+np.random.uniform(size=size)
f9 = -0.3*f10+np.random.uniform(size=size)
f8 = -0.3*f9+np.random.uniform(size=size)
f7 = -0.3*f8+np.random.uniform(size=size)
f6 = -0.3*f7+np.random.uniform(size=size)

np.random.seed(789)
x1 = 0.4*f1 + 0.6*f6 + 0.1*f5 + np.random.uniform(size=size)
x2 = 0.5*f1 + 0.5*f2 + 0.6*f7+ 0.1*f8  + np.random.uniform(size=size)
x3 = 0.5*f2 + 0.5*f4 + 0.6*f8+ 0.1*f9  + np.random.uniform(size=size)
x4 = 0.2*x3 + 0.5*f3 + 0.5*f5 + 0.6*f9+ 0.1*f10  + np.random.uniform(size=size)
x5 = 0.5*f4 + 0.5*f5 + 0.1*f10  + np.random.uniform(size=size)



X = pd.DataFrame(np.array([x1, x2, x3,x4,x5,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10]).T,
                 columns=['x1', 'x2', 'x3', 'x4', 'x5', 'f1', 'f2','f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10'])
X.head()
X.to_csv('LiNGAM_latest6.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 10000
np.random.seed(123)
f1 = np.random.uniform(size=size)
f10 = np.random.uniform(size=size)

np.random.seed(456)
f2 = 0.3*f1+np.random.uniform(size=size)
f3 = 0.3*f2+np.random.uniform(size=size)
f4 = 0.3*f3+np.random.uniform(size=size)
f5 = 0.3*f4+np.random.uniform(size=size)
f9 = -0.3*f10+np.random.uniform(size=size)
f8 = -0.3*f9+np.random.uniform(size=size)
f7 = -0.3*f8+np.random.uniform(size=size)
f6 = -0.3*f7+np.random.uniform(size=size)

np.random.seed(789)
x1 = np.random.uniform(size=size)
x2 = 0.2*x1+0.5*f1 + 0.4*f2 + 0.5*f3  + 0.1*f6+ 0.6*f7+ 0.1*f8 + 0.1*f9  + np.random.uniform(size=size)
x3 = 0.2*x2+0.2*x4+0.4*f3 + 0.5*f5 + 0.6*f8+ 0.1*f10  + np.random.uniform(size=size)
x4 = 0.5*f3 + 0.4*f4 + 0.6*f9 + np.random.uniform(size=size)




X = pd.DataFrame(np.array([x1, x2, x3,x4,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10]).T,
                 columns=['x1', 'x2', 'x3', 'x4', 'f1', 'f2','f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10'])
X.head()
X.to_csv('LiNGAM_latest7.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 10000
np.random.seed(123)
f2 = np.random.uniform(size=size)
np.random.seed(345)
f3 = 3.0*f2+np.random.uniform(size=size)
np.random.seed(567)
f1 = 5.0*f3+np.random.uniform(size=size)

a = 1.2
b = 1.2
np.random.seed(111)
x1 = 2.3*f1 + 0.1*f2 + np.random.uniform(size=size)
np.random.seed(222)
x2 = a*x1 + 3.0*f2 + 1.6*f3 + np.random.uniform(size=size)
np.random.seed(333)
x3 = b*x2 + 1.4*f1 + np.random.uniform(size=size)
np.random.seed(444)
x4 = 1.2*x3 + 1.1*f3 + np.random.uniform(size=size)



X = pd.DataFrame(np.array([x1, x2, x3,x4,f1,f2,f3]).T,
                 columns=['x1', 'x2', 'x3', 'x4', 'f1', 'f2','f3'])
X.head()
X.to_csv('LiNGAM_latest8.csv', index=False)

# +
import numpy as np
import csv
import pandas as pd

size = 10000
np.random.seed(123)
f2 = np.random.uniform(size=size)
np.random.seed(345)
f3 = 3.0*f2+np.random.uniform(size=size)
np.random.seed(567)
f1 = 5.0*f3+np.random.uniform(size=size)

a = 0.9
b = 0.8
np.random.seed(111)
x1 = 2.3*f1 + 0.1*f2 + np.random.uniform(size=size)
np.random.seed(222)
x2 = a*x1 + 3.0*f2 + 1.6*f3 + np.random.uniform(size=size)
np.random.seed(333)
x3 = b*x2 + 1.4*f1 + np.random.uniform(size=size)
np.random.seed(444)
x4 = 1.2*x3 + 1.1*f3 + np.random.uniform(size=size)



X = pd.DataFrame(np.array([x1, x2, x3,x4,f1,f2,f3]).T,
                 columns=['x1', 'x2', 'x3', 'x4', 'f1', 'f2','f3'])
X.head()
X.to_csv('LiNGAM_latest9.csv', index=False)


# +
import numpy as np
import csv
import pandas as pd

size = 1380

np.random.seed(123)
f1 = np.random.uniform(size=size)
np.random.seed(456)
f2 = np.random.uniform(size=size)
np.random.seed(789)
f3 = np.random.uniform(size=size)

np.random.seed(1111)
x3 = f1 + f2 + np.random.uniform(size=size)
np.random.seed(2222)
x1 = f2 + f3 + np.random.uniform(size=size)
np.random.seed(3333)
x6 = f1 + f3 + np.random.uniform(size=size)

np.random.seed(4444)
x5 = 0.16*x3 + 0.3*x1 + 0.08*x6+ np.random.uniform(size=size)
np.random.seed(5555)
x4 = -0.05*x1 - 0.02*x6 + 0.61*x5 + np.random.uniform(size=size)
np.random.seed(6666)
x2 = 0.18*x5 + 0.3*x4 + np.random.uniform(size=size)

X = pd.DataFrame(np.array([x1, x2, x3,x4, x5, x6, f1,f2,f3]).T,
                 columns=['Fathers Occupation', 'Sons Income', 'Fathers Education',
                          'Sons Occupation', 'Sons Education', 'Number of Siblings',
                          'f1', 'f2','f3'])
X.head()
X.to_csv('GSS_sim.csv', index=False)

# -



StarcoderdataJupyterScriptsDedupFiltered