scipy.stats.sampling.TransformedDensityRejection.
ppf_hat#
- TransformedDensityRejection.ppf_hat(u)#
在 u 处评估帽分布的CDF的逆。
- 参数:
- uarray_like
百分位数数组
- 返回:
- ppf_hatarray_like
对应于给定百分位数的分位数数组。
示例
>>> from scipy.stats.sampling import TransformedDensityRejection >>> from scipy.stats import norm >>> import numpy as np >>> from math import exp >>> >>> class MyDist: ... def pdf(self, x): ... return exp(-0.5 * x**2) ... def dpdf(self, x): ... return -x * exp(-0.5 * x**2) ... >>> dist = MyDist() >>> rng = TransformedDensityRejection(dist) >>> >>> rng.ppf_hat(0.5) -0.00018050266342393984 >>> norm.ppf(0.5) 0.0 >>> u = np.linspace(0, 1, num=1000) >>> ppf_hat = rng.ppf_hat(u)