LuasKernel.visualise_covariance_matrix

LuasKernel.visualise_covariance_matrix#

LuasKernel.visualise_covariance_matrix(hp: Any, x_l: Array, x_t: Array, corr: bool | None = False, wn: bool | None = True, x_l_plot: Array | None = None, x_t_plot: Array | None = None, full: bool | None = False) Figure[source]#

Visualise the covariance matrix/matrices generated by the input hyperparameters.

Note

Default behaviour is to separately visualise each of the 4 component covariance matrices Kl, Kt, Sl, St which are used to calculate the full covariance matrix K. If full = True then will instead build the full covariance matrix K but this is very memory intensive as it requires creating a JAXArray with (N_l*N_t, N_l*N_t) entries.

Parameters:
  • hp (Pytree) – Hyperparameters needed to build the covariance matrices Kl, Kt, Sl, St. Will be unaffected if additional mean function parameters are also included.

  • x_l (JAXArray) – Array containing wavelength/vertical dimension regression variable(s) for the observed locations. May be of shape (N_l,) or (d_l,N_l) for d_l different wavelength/vertical regression variables.

  • x_t (JAXArray) – Array containing time/horizontal dimension regression variable(s) for the observed locations. May be of shape (N_t,) or (d_t,N_t) for d_t different time/horizontal regression variables.

  • corr (bool, optional) – If True will plot the correlation between points instead of the covariance. Defaults to False.

  • wn (bool, optional) – Whether to include white noise in the calculation of covariance. Defaults to True.

  • 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).

  • full (bool, optional) – If True will build and visualise the full constructed covariance matrix

Returns:

A figure displaying the covariance of each point in the observed data with the selected point located at (i, j) in the observed data Y.

Return type:

plt.Figure