## 6 Generalisation to Different Datasets
In contrast, Figure 11, which illustrates the t-SNE plot for Nestle stock data, exhibits an almost perfect alignment between the synthetic and real distributions. Since Nestle's stock is generally less volatile than Tesla's, the model is able to generate synthetic data that closely mirror the real time series without significant deviations. The clusters in this plot are tightly packed, and the overall dispersion of synthetic points closely matches that of the real data, indicating that the model has successfully learned the underlying structure of Nestle's price movements with a high degree of accuracy. Figure 12 provides a different perspective by analyzing the ACF differences between real and synthetic data across different lag values for the three stock datasets. The ACF measures how past values influence future values in a time series, making it a critical test for evaluating whether a generative model has successfully captured the temporal dependencies of the original data. The results show that the synthetic Google stock data exhibit the smallest ACF differences, meaning that its temporal structure is closely aligned with the real dataset. The Tesla stock data, on the other hand, presents slightly higher ACF differences, which confirms the observation from the t-SNE analysis that extreme market movements are harder for the model to replicate. The Nestle dataset falls in between, demonstrating that the model performs well with moderate volatility but may struggle with extreme fluctuations. To calculate the predictive score, a recurrent neural network model based on the GRU was developed. The architecture of the model is defined as follows:  
Figure 12: Google, Tesla, and Nestle ACFs. * Masking: the first layer applies a mask to the input data to handle variable length sequences and ignore padding values. * GRU cell: the core of the model is a GRU cell with tanh activation and hidden layer size equal to half the size of the original feature space (hidden_dim = dim/2). * Dense layer: the output of the GRU is passed through a dense layer with sigmoid activation to generate the final prediction. Training takes place following these steps:
* The generated synthetic data are split into mini-batches of size 128. * The model is trained for 5000 iterations using the Adam optimiser, minimising the absolute difference loss function between predicted and actual values. * After training, the model is tested using real data to measure its predictive ability on the original sequences. The predictive score is calculated as the mean absolute error (MAE) between model predictions and actual values. This value aims to reflect how well the synthetic data can maintain temporal and structural consistency with the original time series. Specifically, t-SNE visual inspection reveals the model's capacity to effectively capture the structure of the original data and preserve their nuanced characteristics, regardless of the specific stock context under consideration. The tuning process of the hyperparameters (see Tables 14 and 15) involved a continuous increase in the complexity of the VAE architecture to capture the more specific characteristics of the original data. The training process, performed without a GPU, required 1296.3557 s (approximately 21.61 min) and consumed a peak of 397.73 MB of RAM. \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline Sequence length & 14 \\ \hline Feature dimension & 6 \\ \hline Latent space dimension & 8 \\ \hline Hidden layer sizes & [64; 128; 256] \\ \hline initial\_learning\_rate & 0.001 \\ \hline decay\_steps & 3000 \\ \hline decay\_rate & 0.9 \\ \hline Activation function & relu \\ \hline Dropout rate & 0.01 \\ \hline Reconstruction weight & 3 \\ \hline Batch size & 16 \\ \hline Max epochs & 150 \\ \hline Verbose & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 14: VAE hyperparameters.