## 5 Experiments
### Model Parametrization  
Tables 6-8 show the model parameters and the execution time of VAE-GRU without and with MCMC. Figure 8: Predictive score of the VAE with MCMC sampling across different sizes of the generated synthetic data. To improve the selection of hyperparameters and the robustness of the results, two main strategies were implemented, an intensive tuning of the model's hyperparameters and the adoption of cross-validation. Through the use of a hyperparameter optimisation framework, it was possible to explore a wider range of model configurations. The research involved the exploration of the following values for each hyperparameter:  
* Size of latent space: values explored between 4, 8, 16 and 32. * Size of hidden levels: for each of the three hidden levels, values between 32 and 256 were tested in steps of 32. * Learning rate: values of 0.01, 0.001, 0.0005, and 0.0001 were tested. * Dropout rate: dropout rates of 0.01, 0.1, 0.2, and 0.3 were evaluated to improve generalisation ability. * Reconstruction weight: values explored include 1, 3, 5, and 10. * Batch size: batch sizes 8, 16, 32, and 64 were tested. The approach allowed the various configurations to be evaluated with up to 150 epochs and a reduction factor of 3. The metric used to optimise the model was the validation loss. At the end of the process, val_loss was 71.47171020507812. The best hyperparameters are characterised by Table 9:  
To further improve the robustness and generalisability of the results, cross-validation with five folds using the KFold library was adopted. This approach allowed the dataset to be divided into five subgroups, alternating the roles of training and validation. Each model was trained for a maximum of 150 epochs in each fold. Quantitative metrics and KS statistics are shown in Tables 10 and 11. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Dataset** & **Discriminative Score** & **Predictive Score** \\ \hline Google Model (100\% Train) & & \\ Optimal Hyperparameter & 0.2014 \(\pm\) 0.2199 & 0.0662 \(\pm\) 0.0004 \\ Google Model (100\% Train) & 0.1975 \(\pm\) 0.2112 & 0.0684 \(\pm\) 0.0002 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Quantitative metrics. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Best Value So Far** \\ \hline latent\_dim & 32 \\ hidden\_size\_0 & 160 \\ hidden\_size\_1 & 160 \\ hidden\_size\_2 & 128 \\ learning\_rate & 0.001 \\ dropout\_rate & 0.03 \\ reconstruction\_wt & 1 \\ tuner/epochs & 150 \\ tuner/initial\_epoch & 50 \\ tuner/bracket & 2 \\ tuner/round & 2 \\ tuner/trial\_id & 196 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Hyperparameter tuning results. Figure 9 presents a t-SNE plot illustrating the synthetic data generated by the VAE-GRU-MCMC model for Google stock prices using the best-selected hyperparameters. The purpose of this visualisation is to assess the degree to which the synthetic data distribution aligns with the real data distribution, serving as a qualitative validation of the model's generative capabilities. The plot demonstrates a strong overlap between the real and synthetic data, indicating that the model successfully captures the statistical and temporal structure of Google's stock price movements. Compared to previous t-SNE plots in the study, this representation suggests that the refined hyperparameter tuning has further improved the quality of the generated sequences, leading to a more faithful reproduction of the original dataset. The synthetic points appear well integrated within the real data clusters, reinforcing the idea that the model does not merely replicate general trends but also retains the finer details and variations inherent in the stock price dynamics. By comparing Figure 9 with earlier versions of the model's outputs, one can observe a clear enhancement in performance due to hyperparameter optimisation.