diff --git a/p3/visualise.py b/p3/visualise.py index ed31d62..89902e3 100644 --- a/p3/visualise.py +++ b/p3/visualise.py @@ -43,30 +43,31 @@ plt.close() theta = pd.read_csv('data/theta.csv', header=None) # theta = np.transpose(theta) # -> no need to transpose. -th_columns = ["$ \hat{a}_1 $","$ \hat{a}_2 $","$ \hat{b}_1 $","$ \hat{b}_2 $"] +th_columns = ["$\hat{a}_1 $", "$\hat{a}_2 $", "$\hat{b}_1$", "$\hat{b}_2$"] for i in theta: plt.plot(theta[i], label=th_columns[i]) plt.locator_params(axis='x', nbins=12) plt.legend() -plt.xlabel("$ \mathit{k}T $") -plt.title("ARX Theta (Θ) Parameter Estimation using Recursive Least Squares") +plt.xlabel("$\mathit{k}T$") +plt.title("ARX Theta (θ) Parameter Estimation using RLSq") plt.savefig('res/theta.png', dpi=300) plt.clf() error = pd.read_csv('data/estimate_error.csv', header=None) -plt.plot(error, label="$ ê(\mathit{k}T) $") +plt.plot(error, label="$\hat{e}(\mathit{k}T)$") plt.locator_params(axis='x', nbins=12) plt.legend() -plt.xlabel("$ \mathit{k}T $") -plt.title("ARX RLSq Theta (Θ) Parameter Estimation Error") +plt.xlabel("$\mathit{k}T$") +plt.title("Error of ARX Theta (θ) Parameter Estimation using RLSq") plt.savefig('res/error.png', dpi=300) plt.clf() explicitTheta = pd.read_csv('data/explicit_theta.csv', header=None) + eTx = explicitTheta[0:4] eTy = explicitTheta[4:8] eTxy = [eTx, eTy] @@ -76,10 +77,10 @@ print(explicitTheta) explicitError = pd.read_csv('data/explicit_error.csv', header=None) -plt.plot(explicitError, label="$ ê(\mathit{k}T) $") +plt.plot(explicitError, label="$ê(\mathit{k}T)$") plt.locator_params(axis='x', nbins=12) plt.legend() -plt.xlabel("$ \mathit{k}T $") -plt.title("ARX ELSq Theta (Θ) Parameter Estimation Error") +plt.xlabel("$\mathit{k}T$") +plt.title("Error of ARX Theta (θ) Parameter Estimation using ELSq") plt.savefig('res/explicit_error.png', dpi=300) plt.clf()