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 matrixK
. Iffull = True
then will instead build the full covariance matrixK
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)
ford_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)
ford_t
different time/horizontal regression variables.corr (bool, optional) – If
True
will 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.pcolormesh
for the plot. If not included will default tox_l
ifx_l
is of shape(N_l,)
or tox_l[0, :]
ifx_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 tox_t
ifx_t
is of shape(N_t,)
or tox_t[0, :]
ifx_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 dataY
.- Return type:
plt.Figure