Skip to content

Conversation

@tvatter
Copy link
Contributor

@tvatter tvatter commented Oct 25, 2024

import numpy as np
import pyvinecopulib as pv


def random_data(d=5, n=1000):
  # Simulate some data
  np.random.seed(1234)  # seed for the random generator
  mean = np.random.normal(size=d)  # mean vector
  cov = np.random.normal(size=(d, d))  # covariance matrix
  cov = np.dot(cov.transpose(), cov)  # make it non-negative definite
  x = np.random.multivariate_normal(mean, cov, n)
  return x

d = 5
n = 1000
u = pv.to_pseudo_obs(random_data(d, n))

controls = pv.FitControlsVinecop(family_set=[pv.BicopFamily.gaussian])
cop = pv.Vinecop(u, controls=controls)
cop.plot()

var_names = [f"X{i}" for i in range(d)]
cop.plot(vars_names=var_names)

image

image

@tvatter tvatter mentioned this pull request Oct 25, 2024
4 tasks
@tvatter tvatter merged commit 7aba4fb into dev Oct 26, 2024
@tvatter tvatter deleted the vars_names branch October 26, 2024 12:22
tvatter added a commit that referenced this pull request Oct 27, 2024
* Vectorize the stats functions properly (#151)

* New Vinecop.str() (#153)

* Add variables names option for vinecop plots (#152)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants