LuasKernel.visualise_covariance_in_data

LuasKernel.visualise_covariance_in_data#

LuasKernel.visualise_covariance_in_data(hp: Any, x_l: Array, x_t: Array, i: int, j: int, corr: bool | None = False, wn: bool | None = True, x_l_plot: Array | None = None, x_t_plot: Array | None = None, **kwargs) Figure[source]#

Creates a plot to aid in visualising how the kernel function is defining the covariance between different points in the observed data. Calculates the covariance of each point in the observed data with a point located at (i, j) in the observed data. The plot then displays this covariance using plt.pcolormesh with every other point in the observed data.

If corr = True this will display the correlation instead of the covariance. Also if wn = False then white noise will be excluded from the calculation of the covariance/correlation between each point. This can be helpful if the white noise has a much larger amplitude than correlated noise which can make it difficult to visualise how points are correlated.

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.

  • i (int) – The wavelength/vertical location of the point to visualise covariance with.

  • j (int) – The time/horizontal location of the point to visualise covariance with.

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

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