from sklearn.metrics import r2_score
from mpl_toolkits.mplot3d import Axes3D
from Signal import Signal
from model_list import model

# These constants are also defined in the Signal module
# Don't change here unless you also change them there
numTrials = 1000
nstep = 100
timelength = 100
trainFrac = .7

# Calls the module Signal with the initialization parameters
# then simulates using the initialized model
sig = Signal(numTrials, nstep, timelength, trainFrac)
uArray, yArray, corrArray, conArray, taus, kps, thetas, train, test = sig.simulate(
)

# This may need to be implemented iteratively to determine if stacking
# the three different parameters has any significant impact on predicting the
# value of any of the 3 parameters
xDatas = [yArray, yArray, (yArray - np.mean(yArray)) / np.std(yArray) - uArray]
yDatas = [taus, kps, thetas]

m = model(nstep)
modelList = []

uSum = np.sum(uArray, axis=0)
plt.figure()
plt.plot(np.linspace(0, 100, 100), uSum)

for j in range(0, len(xDatas)):