with pm.Model() as model: sigma_f = pm.HalfNormal("sigma_f", sigma=2.0) l = pm.HalfNormal("l", sigma=1.0) cov = CurlFree(2, sigma_f, l) gp = pm.gp.Marginal(cov_func=cov) y_ = gp.marginal_likelihood("y_", X=X_init, y=y_init - np.mean(y_init), \ noise=sigma_noise)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc/gp/gp.py:56: FutureWarning: The 'noise' parameter has been been changed to 'sigma' in order to standardize the GP API and will be deprecated in future releases.
warnings.warn(_noise_deprecation_warning, FutureWarning)
Standard approach – Independent GPs for each velocity component.
Code
with pm.Model() as model2: sigma_f = pm.HalfNormal("sigma_f", sigma=1) l = pm.HalfNormal("l", sigma=1.0) cov = SquaredExp(2, sigma_f, l) gp = pm.gp.Marginal(cov_func=cov) y_ = gp.marginal_likelihood("y_", X=X_init[0:num_random_points,:].reshape(num_random_points, 2), \ y=y_init[0:num_random_points] - np.mean(y_init[0:num_random_points]), \ noise=1e-4)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc/gp/gp.py:56: FutureWarning: The 'noise' parameter has been been changed to 'sigma' in order to standardize the GP API and will be deprecated in future releases.
warnings.warn(_noise_deprecation_warning, FutureWarning)
Code
with model2: mp2 = pm.find_MAP()
Code
with model2: post_mean2, post_covar2 = gp.predict(Xpred, point=mp2, diag=False)
Code
with pm.Model() as model3: sigma_f = pm.HalfNormal("sigma_f", sigma=1) l = pm.HalfNormal("l", sigma=1.0) cov = SquaredExp(2, sigma_f, l) gp = pm.gp.Marginal(cov_func=cov) y_ = gp.marginal_likelihood("y_", X=X_init[0:num_random_points,:].reshape(num_random_points, 2), \ y=y_init[num_random_points:] - np.mean(y_init[num_random_points:]), \ noise=1e-4)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc/gp/gp.py:56: FutureWarning: The 'noise' parameter has been been changed to 'sigma' in order to standardize the GP API and will be deprecated in future releases.
warnings.warn(_noise_deprecation_warning, FutureWarning)