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 usingplt.pcolormeshwith every other point in the observed data.If
corr = Truethis will display the correlation instead of the covariance. Also ifwn = Falsethen 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)ford_ldifferent 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)ford_tdifferent 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
Truewill plot the correlation between points instead of the covariance. Defaults toFalse.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.pcolormeshfor the plot. If not included will default tox_lifx_lis of shape(N_l,)or tox_l[0, :]ifx_lis of shape(d_l, N_l).x_t_plot (JAXArray, optional) – The values on the x-axis used by
plt.pcolormeshfor the plot. If not included will default tox_tifx_tis of shape(N_t,)or tox_t[0, :]ifx_tis 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 dataY.- Return type:
plt.Figure