bebi103.gp.posterior_mean_cov_deriv
- bebi103.gp.posterior_mean_cov_deriv(X, y, Xstar, sigma, kernel=<function se_kernel>, delta=1e-08, **kernel_hyperparams)
Compute the posterior mean vector and covariance matrix for the derivative of a posterior Gaussian process derived from a Normal likelihood and Gaussian process prior.
- Parameters:
X (1D, shape (n,)) – Array of n data points for which observations were made. If a 1D array, assume the points are one-dimensional. Note that these are NOT observations of derivatives; derivatives will be calculated.
y (array, shape (n,)) – Measured data points.
Xstar (1D, shape (nstar,) or 2D array, shape (nstar, d)) – Array of nstar data points for posterior predictions are to be made. If a 1D array, assume the points are one-dimensional. If a 2D array, assume the points are d-dimensional.
sigma (float or array, shape (n,)) – Standard deviation for Normal likelihood. If a float, assumed to be homoscedastic for all points.
kernel (function, default se_kernel) – Kernel defining the Gaussian process. Must have call signature kernel(x1, x2, **kernel_hyperparams).
include_deriv (bool, default False) – If True, include first derivatives in mean vectors and covariances. If True, X and Xstar must both be 1D because multivariate gradients are not implemented.
delta (float, default 1e-8) – Small number, used to add to the diagonal of covariance matrices to ensure numerical positive definiteness.
**kernel_hyperparams (kwargs) – All additional kwargs are sent as kwargs to the kernel function.
- Returns:
g (array, shape (nstar,)) – The derivative function of the Gaussian process posterior evaluated at the points given by Xstar.
Sigma_g (array, shape (nstar, nstar)) – The covariance matrix for the derivative of the Gaussian process posterior evaluated at the points given by Xstar.
Notes
Multidimensional x-values and other kernels will hopefully be implemented later.