GP.plot

Contents

GP.plot#

GP.plot(p: Any, Y: Array, x_l_plot=None, x_t_plot=None, **kwargs) Figure[source]#

Visualises the fit to the data. Displays the observed data as well as the mean function, the GP predictive mean (not including the mean function) and the residuals of the data after subtraction of the GP predictive mean (including the mean function).

For a good fit to the data, the data minus the GP predictive mean should consist of white noise with no remaining correlations. The GP predictive mean (not including the mean function) should also just be fitting correlated noise and should not look like its fitting the mean function.

Parameters:
  • p (PyTree) – Pytree of hyperparameters used to calculate the covariance matrix in addition to any mean function parameters which may be needed to calculate the mean function.

  • Y (JAXArray) – Observed data to fit, must be of shape (N_l, N_t).

  • x_l_plot (JAXArray, optional) – The values on the y-axis used by plt.pcolormesh for the plot. If not included will default to x_l if x_l is of shape (N_l,) or to x_l[0, :] if x_l is of shape (d_l, N_l).

  • x_t_plot (JAXArray, optional) – The values on the x-axis used by plt.pcolormesh for the plot. If not included will default to x_t if x_t is of shape (N_t,) or to x_t[0, :] if x_t is of shape (d_t, N_t).

Returns:

The figure object containing the plot produced.

Return type:

plt.Figure