@@ -4223,26 +4223,20 @@ class Interpolated(BoundedContinuous):
4223
4223
Both parameters ``x_points`` and values ``pdf_points`` are not variables, but
4224
4224
plain array-like objects, so they are constant and cannot be sampled.
4225
4225
4226
- ======== ===========================================
4227
- Support :math:`x \in [x\_points[0], x\_points[-1]]`
4228
- ======== ===========================================
4229
-
4226
+ .. plot::
4230
4227
import matplotlib.pyplot as plt
4231
4228
import numpy as np
4232
4229
import pymc3 as pm
4230
+ import arviz as az
4233
4231
import warnings
4234
4232
warnings.simplefilter(action="ignore", category=FutureWarning)
4235
4233
from scipy.stats import gamma
4236
- a = 1.99
4237
- mean, var, skew, kurt = gamma.stats(a, moments='mvsk')
4238
- rv = gamma(a)
4234
+ rv = gamma(1.99)
4239
4235
x = np.linspace(rv.ppf(0.01),rv.ppf(0.99), 1000)
4240
4236
points = np.linspace(x[0], x[-1], 50)
4241
4237
pdf = rv.pdf(points)
4242
4238
interpolated = pm.Interpolated.dist(points, pdf)
4243
4239
plt.style.use('arviz-darkgrid')
4244
- plt.style.use('tableau-colorblind10')
4245
- #plt.set_cmap('coolwarm')
4246
4240
fig, ax = plt.subplots(1, 1)
4247
4241
ax.plot(x, rv.pdf(x), 'C0', linestyle = '--', label='Original Gamma pdf',alpha=0.8,lw=2)
4248
4242
ax.plot(points, pdf, color='black', marker='o', label='Lattice Points',alpha=0.5,linestyle='')
@@ -4252,6 +4246,10 @@ class Interpolated(BoundedContinuous):
4252
4246
ax.legend(loc='best', frameon=False)
4253
4247
plt.show()
4254
4248
4249
+ ======== ===========================================
4250
+ Support :math:`x \in [x\_points[0], x\_points[-1]]`
4251
+ ======== ===========================================
4252
+
4255
4253
Parameters
4256
4254
----------
4257
4255
x_points: array-like
0 commit comments