Python und Gaussian Copula

mit matplotlib, NumPy, pandas, SciPy, SymPy und weiteren mathematischen Programmbibliotheken.
Antworten
asahdkhaled
User
Beiträge: 29
Registriert: Samstag 28. Oktober 2017, 22:07

Hallo, ich bin in letzter Zeit ein treuer Gast in diesem Forum.
Ich habe bisher wirklich unglaublich gute Hilfe bekommen und ich dachte, vielleicht fällt jemanden zu meinem jetzigen Problem auch etwas schlaues ein :lol:

Mein Problem lässt sich wie folgt beschrieben:
1. Ich habe eine Spalte (sagen wir x)
2. Auf diese Spalte habe ich bereits die cdf() Funktion angewendet und habe die Ergebnisse in eine neue Spalte x_F gespeichert.
--> Ich habe also die ursprungsspalte x und die berechnete Spalte x_F, mit den CDF-Werten

Jetzt möchte ich folgendes machen:
--> da sganze beruht auf einen Abschnitt in einem Paper den ich gerne umsetzen würde:
A visual depiction of applying the Gaussian Copula process to normalize
an observation by applying n = PHI−1(F(x)). Calculating F(x) yields a value u ∈ [0, 1]
representing the proportion of shaded area at the left. Then PHI−1(u) yields a value n
by matching the shaded area in a Gaussian distribution.
und ist mit folgendem Bild hinterlegt:

Bild


Ich möchte also, mit Hilfe einer Gaussian Copula (wobei mir noch nicht wirklich klar ist, was das genau ist), meine Werte der Spalte x in eine Gaussian Distribution umwandeln.

Laut dem Text geht das, indem ich das inverse der cdf() Funktion anwende, was laut google

Code: Alles auswählen

n.cdf(n.ppf(0.95))
wäre. Das ist aber natürlich nicht das was ich will. Das Bild und der Text zusammen macht mein Problem gut deutlich hoffe ich.
Hat jemand eine Idee??



EDIT:

Hier auch nochmal eine Schritt für Schritt Anleitung aus dem Paper:
For this reason, we turn to the multivariate version of the Gaussian Copula described
in Section 3.2. The Gaussian Copula removes any bias that the distribution
shape may induce, by converting all column distributions to standard normal before
finding the covariances. Steps to model a Gaussian Copula are:
1. We are given the columns of the table 0, 1, . . . , n, and their respective cumulative
distribution functions F0, . . . , Fn.
2. Go through the table row-by-row. Consider each row as a vector
X = (x0, x1, . . . , xn).
3. Convert the row using the Gaussian Copula:
Y = [PHI−1 (F0 (x0)) ,PHI−1 (F1 (x1)) , . . . ,PHI−1 (Fn (xn))]
where PHI−1(Fi(xi)) is the inverse cdf of the Gaussian distribution applied to the
cdf of the original distribution.


asahdkhaled
User
Beiträge: 29
Registriert: Samstag 28. Oktober 2017, 22:07

Meine bisherigen Recherchen haben ergeben, dass es verschiedene Möglichkeiten gibt:

**SO FOR NOWTHERE A 3 DIFFERENT IDEAS, AND ALL DONT GIVE ME THE RESULTS I NEED:**

1. inverse transform method
2. Box-Mueller Method
3. invgauss
4. ppf of cdf
5. gauss = 1/(sqrt(2*pi)*s)*e**(-0.5*(float(x-m)/s)**2)


Siehe Link:

https://stats.stackexchange.com/questio ... rse-of-cdf
Antworten