Fixed issue NelsonAalenFitter.plot_hazard
@@ -159,13 +159,13 @@ class NelsonAalenFitter(UnivariateFitter):
return self
def plot_hazard(self, bandwidth=None, **kwargs):
- if kwargs.get("bandwidth") is None:
+ if bandwidth is None:
raise ValueError(
"Must specify a bandwidth parameter in the call to plot_hazard, e.g. `plot_hazard(bandwidth=1.0)`"
)
estimate = self.smoothed_hazard_(bandwidth)
confidence_intervals = self.smoothed_hazard_confidence_intervals_(bandwidth, estimate.values[:, 0])
- return _plot_estimate(self, estimate, confidence_intervals=confidence_intervals, **kwargs)
+ return _plot_estimate(self, estimate, confidence_intervals=confidence_intervals, bandwidth=bandwidth, **kwargs)
def _bounds(self, cumulative_sq_, alpha, ci_labels):
z = inv_normal_cdf(1 - alpha / 2)
