fits}
\end{figure*}

\newpage

\section{Structure Function Analysis}

Ideally we would like to examine the PSD of the Gaussian process fits to the observational data. The PSD characterises the distribution of power over frequencies of a given emission band and properties of the PSD can be linked to underlying physical processes in the accretion disk. Computation of the PSD, while possible, can be complicated by the uneven sampling of the observational data, leading previous studies to instead perform a structure function analysis on the Mrk~335 \: data \citep{gallo18}. While it is possible to extract the PSD from the learned kernel \citep{2019_Wilkins}, in this work we choose to perform a structure function analysis of the \textsc{gp} lightcurves in order to compare directly against the results of \cite{gallo18}. We follow the method described in \cite{1985_Simonetti, 1992_Hughes, 1996_di_Clemente, 2001_Collier, gallo18}. The binned structure function is defined as:

\begin{align}
    \text{SF}(\tau) = \frac{1}{N(\tau)} \sum_{i} \: [f(t_i) - f(t_i + \tau)]^2
\end{align}

where $\tau = t_j - t_i$ is the distance between pairs of points $i$ and $j$ such that $t_j > t_i$. The structure function is binned according to $\tau$ where the centres of each bin are given by $\tau_i = (i - \frac{1}{2})\delta$. $\delta$ in this instance is the structure function resolution. We use the same $\delta$ as in \cite{gallo18}, namely 5.3 days for the structure function computation over both the X-ray and UVW2 bands. $f(t_i)$ gives the count rate value at time point $t_i$ and $N(\tau)$ is the number of structure function pairs in each bin $i$ with centre $\tau_i$. Accounting for measurement noise by subtracting twice the mean noise variance from each structure function bin, as performed in \cite{gallo18} was found to have negligible effect on the \textsc{gp} structure functions and so we ignore it. As in \cite{gallo18}, we normalise the structure function values by the global lightcurve variance. 

The \textsc{gp} structure functions for the interpolated lightcurves are shown in \autoref{GP Structure Functions}. The $1\sigma$ \textsc{gp} error bars are obtained by computing the structure function over 50 samples from the Gaussian process posterior. Each sample gives rise to highly similar structure functions and so the errors are not visible on the plot. The structure functions computed from the observational data, 509 and 498 data points for the X-ray and UV bands of Mrk~335 \: respectively, are included for reference. In contrast to the \textsc{gp} structure function errorbars, in the case of the observational data the error bars are computed as $\frac{\sigma_i}{\sqrt(\frac{N_i}{2})}$ where $\sigma_i$ is the noise standard deviation in bin $i$ and $N_i$ is the number of pairs in bin $i$.\\ 

The Gaussian process structure functions are compared against the observational structure functions in \autoref{GP Structure Functions}. In addition, we plot broken power law fits to the \textsc{gp} structure functions, the parameters of which are given in \autoref{params}. In the UVW2 band, both Gaussian process kernels yield structure functions possessing a consistent break point at ca. 125 days. In the X-ray band the Matern $\frac{1}{2}$ kernel yields a break point at 66 days whereas the rational quadratic kernel fit yields an unbroken power law. Given the discrepancy between \textsc{gp} kernels, we do not find definite evidence for a break in the X-ray power law.

Of particular interest is whether the dip in the X-ray structure function is an expected feature of the latent lightcurve or a measurement artefact arising from uneven sampling. In order to assess the potential for the dip to be a sampling artefact, we perform simulations using the Timmer and Konig algorithm from \autoref{sim_section}. In this case we compute structure functions of gapped lightcurves and compare against structure functions derived from the ground truth lightcurves with no gaps. One representative simulation is depicted in \autoref{sf_sims}. In this instance a similar dip to that found in the observational data is observed in the X-ray band simulation. This highlights the possiblity that the dip seen in the observational X-ray structure function is a sampling artefact arising from gaps in the lightcurve.

\begin{figure*}[]
\centering
\subfigure[Matern $\frac{1}{2}$ UVW2]{\label{fig:4pp}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/new_gp_structure_functions_stan_error/gp_structure_function_uv_Matern.png}}
\subfigure[Rational Quadratic UVW2]{\label{fig:4pp}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/new_gp_structure_functions_stan_error/gp_structure_function_uv_RQ.png}}  
\subfigure[Matern $\frac{1}{2}$ X-ray]{\label{fig:4pp}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/new_gp_structure_functions_stan_error/gp_structure_function_xray_Matern.png}}
\subfigure[Rational Quadratic X-ray]{\label{fig:4pp}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/new_gp_structure_functions_stan_error/gp_structure_function_xray_RQ.png}}
\caption{Comparison of observational and \textsc{gp} structure functions. The \textsc{gp} structure functions are consistent with those calculated from the observational data in the non-noise dominated regions. The dip at ca. $200$ days in the observational X-ray structure function is potentially a sampling artefact as demonstrated by simulation in \autoref{sf_sims}.}
\label{GP Structure Functions}
\end{figure*}

\begin{table}[]
\caption{Parameters for the broken power law fits to the \textsc{gp} structure functions. $\alpha_1$ and $\alpha_2$ are the indices for the power law before and after the break point $\tau_{char}$. The break point $\tau_{char}$ is reported in days. Errors are computed using 200 bootstrap samples of the data points corresponding to the GP structure functions. The X-ray rational quadratic structure function is fit using a power law and as such only has a single index as a parameter. The astropy library \citep{astropy_1, astropy_2} is used to compute the (broken) power law fits using the simplex algorithm and least squares statistic for optimisation with the \textsc{gp} structure function uncertainties used as weights in the fitting.}
\begin{center}
\begin{tabular}{lllll}
\hline
Waveband & Kernel & $\alpha_1$ & $\alpha_2$ & $\tau_{char}$ \\ \hline
UVW2 & Matern $\frac{1}{2}$ & $-0.72 \pm \: 0.03$ & $-0.26 \pm \: 0.01$ & $127 \pm \: 8$ \\
UVW2 & Rational Quadratic & $-0.62 \pm \: 0.01$ & $-0.28 \pm \: 0.01$ & $125 \pm \: 5$ \\
X-ray & Matern $\frac{1}{2}$ & $-0.29 \pm \: 0.03$ & $-0.07 \pm \: 0.004$ & $66 \pm \: 8$ \\
X-ray & Rational Quadratic & $-0.21 \pm \: 0.002$ & N/A & N/A \\ \hline
\end{tabular}
\end{center}
\label{params}
\end{table}

\begin{figure*}[]
\centering
\subfigure[Observational]{\label{fig:sf_sim}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/sf_simulations/ground_truth_function_xray_on_same_axis_.png}}
\subfigure[\textsc{gp} | Matern $\frac{1}{2}$]{\label{fig:sf_sim2}\includegraphics[width=0.49\textwidth]{Ryan/experiment_log_figures/sf_simulations/gp_function_xray_Matern_on_same_axis_10.png}}
\caption{Structure function simulations. Pseudo-observational lightcurves are produced by introducing gaps into the simulated lightcurves. The structure function for the gapped lightcurve is shown in red in (a) whereas the structure function of the \textsc{gp} interpolation