पैरामीट्रिक एस्टिमेशन

Python में Quantitative Risk Management

Jamsheed Shorish

Computational Economist

डिस्ट्रीब्यूशनों की एक क्लास

  • लॉस डिस्ट्रीब्यूशन: निश्चित रूप से ज्ञात नहीं
  • संभावित डिस्ट्रीब्यूशनों की क्लास?
    • मान लें डिस्ट्रीब्यूशन की क्लास $f(x; \theta)$
    • $x$ लॉस है (रैंडम वैरिएबल)
    • $\theta$ अज्ञात पैरामीटर्स का वेक्टर है
  • उदाहरण: Normal डिस्ट्रीब्यूशन
    • पैरामीटर्स: $\theta = (\mu, \sigma)$, mean $\mu$ और standard deviation $\sigma$
  • पैरामीट्रिक एस्टिमेशन: दिए डेटा पर 'सबसे अच्छा' $\theta^\star$ खोजें
  • लॉस डिस्ट्रीब्यूशन: $f(x,\theta^\star)$
Python में Quantitative Risk Management

डिस्ट्रीब्यूशन फिट करना

  • एरर कम करने के मानदंड से डिस्ट्रीब्यूशन फिट करें
    • उदाहरण: scipy.stats.norm.fit(), डेटा पर Normal डिस्ट्रीब्यूशन फिट करना
      • परिणाम: ऑप्टिमली फिटेड mean और standard deviation
  • फायदे:
    • हिस्टोग्राम से डेटा और अनुमान का फर्क विजुअलाइज़ कर सकते हैं
    • goodness-of-fit टेस्ट दे सकते हैं
Python में Quantitative Risk Management

Goodness of fit

  • अनुमानित डिस्ट्रीब्यूशन डेटा पर कितना अच्छा फिट होता है?
  • विजुअलाइज़: पोर्टफोलियो लॉसेस का हिस्टोग्राम प्लॉट करें

लॉसेस का हिस्टोग्राम इमेज

Python में Quantitative Risk Management

Goodness of fit

  • अनुमानित डिस्ट्रीब्यूशन डेटा पर कितना अच्छा फिट होता है?
  • विजुअलाइज़: पोर्टफोलियो लॉसेस का हिस्टोग्राम प्लॉट करें
  • norm.fit() के साथ Normal डिस्ट्रीब्यूशन

नॉर्मल डिस्ट्रीब्यूशन सहित लॉसेस का हिस्टोग्राम

Python में Quantitative Risk Management

Goodness of fit

  • अनुमानित डिस्ट्रीब्यूशन डेटा पर कितना अच्छा फिट होता है?
  • विजुअलाइज़: पोर्टफोलियो लॉसेस का हिस्टोग्राम प्लॉट करें
  • उदाहरण:
    • norm.fit() के साथ Normal डिस्ट्रीब्यूशन
    • t.fit() के साथ Student's t-डिस्ट्रीब्यूशन
    • क्या हिस्टोग्राम असिमेट्रिकल है?

नॉर्मल डिस्ट्रीब्यूशन सहित लॉसेस का हिस्टोग्राम

Python में Quantitative Risk Management

Anderson-Darling टेस्ट

  • Goodness of fit का सांख्यिकीय टेस्ट
    • नल परिकल्पना: डेटा Normally distributed है
    • टेस्ट स्टैटिस्टिक critical_values से बड़ा हो तो Normal डिस्ट्रीब्यूशन रिजेक्ट
  • scipy.stats.anderson इम्पोर्ट करें
  • loss डेटा पर टेस्ट रिजल्ट कंप्यूट करें
from scipy.stats import anderson

anderson(loss)
AndersonResult(statistic=11.048641503898523,
critical_values=array([0.57 , 0.649, 0.779, 0.909, 1.081]),
significance_level=array([15. , 10. ,  5. ,  2.5,  1. ]))
Python में Quantitative Risk Management

Skewness

  • Skewness: डेटा कितना non-symmetric डिस्ट्रीब्यूटेड है, इसकी डिग्री
    • Normal डिस्ट्रीब्यूशन: symmetric

नॉर्मल डिस्ट्रीब्यूशन

Python में Quantitative Risk Management

Skewness

  • Skewness: डेटा कितना non-symmetric डिस्ट्रीब्यूटेड है, इसकी डिग्री
    • Normal डिस्ट्रीब्यूशन: symmetric
    • Student's t-डिस्ट्रीब्यूशन: symmetric

नॉर्मल और t डिस्ट्रीब्यूशंस

Python में Quantitative Risk Management

Skewness

  • Skewness: डेटा कितना non-symmetric डिस्ट्रीब्यूटेड है, इसकी डिग्री
    • Normal डिस्ट्रीब्यूशन: symmetric
    • Student's t-डिस्ट्रीब्यूशन: symmetric
  • Skewed Normal डिस्ट्रीब्यूशन: asymmetric
    • Normal इसका special case है
    • पोर्टफोलियो डेटा में उपयोगी, जैसे लॉसेस gains से अधिक हों
    • scipy.stats में skewnorm के रूप में उपलब्ध

नॉर्मल, t और स्क्यूड नॉर्मल डिस्ट्रीब्यूशंस

Python में Quantitative Risk Management

Skewness का परीक्षण

  • डेटा symmetric डिस्ट्रीब्यूशन से कितना दूर है, यह टेस्ट करें: scipy.stats.skewtest
  • नल परिकल्पना: कोई skewness नहीं
  • scipy.stats से skewtest इम्पोर्ट करें
  • loss डेटा पर टेस्ट रिजल्ट निकालें
    • सांख्यिकीय रूप से significant => skewness वाली डिस्ट्रीब्यूशन क्लास उपयोग करें
from scipy.stats import skewtest

skewtest(loss)
SkewtestResult(statistic=-7.786120875514511,
pvalue=6.90978472959861e-15)
Python में Quantitative Risk Management

अभ्यास करते हैं!

Python में Quantitative Risk Management

Preparing Video For Download...