# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# +

from sigvisa.treegp.gp import GPCov, GP, prior_sample, mcov
import scipy.stats

# +
# step 1: sample from a GP

cov1 = GPCov(wfn_params=np.array((1.0,)), dfn_params=((2.0,)), wfn_str="se", dfn_str="euclidean")

x = np.linspace(-5, 5, 50).reshape((-1, 1))
K = mcov(x, cov1, 0.0)
fx = scipy.stats.multivariate_normal(mean=np.zeros((x.shape[0],)), cov=K).rvs(2)

A = np.array(((0.8, 0.2), (0.2, 0.8)))

Afx = np.dot(A, fx)

plot(x, Afx[0, :])
plot(x, Afx[1, :])
# -





StarcoderdataJupyterScriptsDedupFiltered