Comments (2)
Dear Manuel
thanks, actually googling a bit I was able to find out almost the same,
and indeed I already implemented it some dais ago it in my to be cleaned
minimal https://github.com/lstorchi/markovctheil/blob/master/copula_cli.py
copula CLI .
thanks again
from copulas.
Hi @lstorchi, and thanks for your questions,
I'm not Matlab expert, and the answers are based on what I've been able to grasp after reading the documentation of copulastat
and copularnd
modules, so please correct me if I'm wrong
r = copulastat('Gaussian',rho) returns the Kendall’s rank correlation, r, that corresponds to a Gaussian copula with linear correlation parameters rho.
If I'm not mistaken, what you intend to do, can't be done directly using our package, but can be done easily using pandas.DataFrame.corr
directly on your raw data.
u = copularnd('Gaussian',rho,n) returns n random vectors generated from a Gaussian copula with linear correlation parameters rho.
We have not implemented a way to sample from a copula passing directly the linear correlation parameters. What we do is compute the correlation from the raw data, and when sampling, we return the sampled values in the same space that the raw data.
However, as the gaussian copula is based on the Gaussian Multivariate distribution, you can archieve this by doing:
import numpy as np
# We are assuming `rho` is your correlation parameters in a numpy.array
# We are assuming `n` is the number of vector you want to sample.
size = rho.shape[0]
means = np.zeros(size)
np.random.multivariate_normal(means, rho, size=n)
from copulas.
Related Issues (20)
- Drop support for Python 3.7
- Using any univariate distribution from scipy HOT 1
- When Copulas univariate fit fails, produce a log instead of a warning
- Switch default branch from master to main
- Update add-on detection for Copulas
- Alpha and Beta can be out of bounds for beta distribution causing Nans to appear
- VineCopula is not working NonImplementedError for pdf and cdf HOT 2
- Support Python 3.12
- supports dynamic copulas
- Set `allow_singular=True` when calculating probability_density
- Transition from using setup.py to pyroject.toml to specify project metadata
- Remove bumpversion and use bump-my-version
- Switch to using ruff for Python linting and code formatting
- Add build to dev requirements
- Digital Object Indentifier for Copulas HOT 2
- Add dependency checker
- .fit method parameter HOT 2
- Add bandit workflow
- Fix minimum version workflow when pointing to github branch
- Implementation of a Hüsler-Reiss Copula HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from copulas.