Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# maybe compute ppf of y
if fitprobs in ['y', 'both']:
y = dist.ppf(y / 100.)
# maybe compute log of x
if fitlogs in ['x', 'both']:
x = numpy.log(x)
# maybe compute log of y
if fitlogs in ['y', 'both']:
y = numpy.log(y)
yhat, results = algo._fit_simple(x, y, xhat, fitlogs=fitlogs)
if estimate_ci:
yhat_lo, yhat_hi = algo._bs_fit(x, y, xhat, fitlogs=fitlogs,
niter=niter, alpha=alpha)
else:
yhat_lo, yhat_hi = None, None
# maybe undo the ppf transform
if fitprobs in ['y', 'both']:
yhat = 100. * dist.cdf(yhat)
if yhat_lo is not None:
yhat_lo = 100. * dist.cdf(yhat_lo)
yhat_hi = 100. * dist.cdf(yhat_hi)
# maybe undo ppf transform
if fitprobs in ['x', 'both']:
xhat = 100. * dist.cdf(xhat)
results['yhat_lo'] = yhat_lo
x = dist.ppf(x / 100.)
xhat = dist.ppf(numpy.array(xhat) / 100.)
# maybe compute ppf of y
if fitprobs in ['y', 'both']:
y = dist.ppf(y / 100.)
# maybe compute log of x
if fitlogs in ['x', 'both']:
x = numpy.log(x)
# maybe compute log of y
if fitlogs in ['y', 'both']:
y = numpy.log(y)
yhat, results = algo._fit_simple(x, y, xhat, fitlogs=fitlogs)
if estimate_ci:
yhat_lo, yhat_hi = algo._bs_fit(x, y, xhat, fitlogs=fitlogs,
niter=niter, alpha=alpha)
else:
yhat_lo, yhat_hi = None, None
# maybe undo the ppf transform
if fitprobs in ['y', 'both']:
yhat = 100. * dist.cdf(yhat)
if yhat_lo is not None:
yhat_lo = 100. * dist.cdf(yhat_lo)
yhat_hi = 100. * dist.cdf(yhat_hi)
# maybe undo ppf transform
if fitprobs in ['x', 'both']: