# Bayes factor spearman correlation

**URL:** <https://discourse.pymc.io/t/bayes-factor-spearman-correlation/14151>\
**Category:** General\
**Created:** [April 1, 2024, 4:04pm UTC](https://discourse.pymc.io/t/bayes-factor-spearman-correlation/14151 "2024-04-01T16:04:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![iavicenna](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/iavicenna/32/7923_2.png) [@iavicenna](https://discourse.pymc.io/u/iavicenna)\
**Post date:** [April 1, 2024, 9:10pm UTC](https://discourse.pymc.io/t/bayes-factor-spearman-correlation/14151/2 "2024-04-01T21:10:14Z")

</div>

Hello,

Perhaps combining the methods in the link below with transforming your x and y variables via rankdata of scipy would be the way to go:

> [@Bayesian correlation coefficient](https://discourse.pymc.io/t/bayesian-correlation-coefficient/12108):
>
> Hi, I was attempting to infer Pearson-like correlation coefficients using [this PYMC3-based notebook](https://nbviewer.org/github/sebp/bayesian-correlation/blob/master/bayesian_correlation_pymc3.ipynb) as basis, but I cannot figure out how to initiate the precision matrix for PYMC5. The core code is this: import theano.tensor as T def precision(sigma, rho): C = T.alloc(rho, 2, 2) C = T.fill\_diagonal(C, 1.) S = T.diag(sigma) return T.nlinalg.matrix\_inverse(S.dot(C).dot(S)) def analyze(data): with pm.Model() as model: # priors might be adapted here to be less flat …

> **[Bayesian copula estimation: Describing correlated joint distributions](https://www.pymc.io/projects/examples/en/latest/howto/copula-estimation.html)**
>
> The problem: When we deal with multiple variables (e.g. a and b) we often want to describe the joint distribution P(a, b) parametrically. If we are lucky, then this joint distribution might be ‘sim...

---

_[View the full topic](https://discourse.pymc.io/t/bayes-factor-spearman-correlation/14151)._
