Ejercicio 1: Hacer este gŕafico en Python.
In [37]:
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stas
%matplotlib inline
In [27]:
x = np.arange(0.01, 1, 0.01)
values = [(0.5, 0.5),(5, 1),(1, 3),(2, 2),(2, 5)]
In [28]:
for i, j in values:
y = stas.beta.pdf(x,i,j)
plt.plot(x,y)
plt.show()
Ejercicio 2: Con datos aleatorios de distribuciones beta, obtener y graficar sus propiedades descriptivas.
In [59]:
md = []
mn = []
mo = []
kur = []
ske = []
for i, j in values:
r = stas.beta.rvs(i, j, size=1000000)
md.append(np.median(r))
mn.append(np.mean(r))
mo.append(stas.mode(r)[0][0])
kur.append(stas.kurtosis(r))
ske.append(stas.skew(r))
In [58]:
fig = plt.figure()
ax1 = fig.add_subplot(151)
ax1.set_title('Median')
ax1.plot(md)
ax2 = fig.add_subplot(152)
ax2.set_title('Mean')
ax2.plot(mn)
ax3 = fig.add_subplot(153)
ax3.set_title('Mode')
ax3.plot(mo)
ax4 = fig.add_subplot(154)
ax4.set_title('Kurtosis')
ax4.plot(kur)
ax5 = fig.add_subplot(155)
ax5.set_title('Skewness')
ax5.plot(ske)
axes = [ax1, ax2, ax3, ax4, ax5]
for i in axes:
plt.setp(i.get_xticklabels(), visible=False)
plt.setp(i.get_yticklabels(), visible=False)
Ejercicio 3: escogiendo un dataset realizar una regresión linear y evaluar el modelo.
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: