pastas.solver.least_squares.LeastSquaresBase.prediction_interval#

pastas.solver.least_squares.LeastSquaresBase.prediction_interval(n: int = 1000, alpha: float = 0.05, max_iter: int = 10, **kwargs) pandas.DataFrame#

Calculate the prediction interval for the simulation.

Parameters:
  • n (int, optional) – Number of random samples drawn from the bivariate normal distribution to compute the prediction interval. Default is 1000.

  • alpha (float, optional) – Significance level for the prediction interval. Default is 0.05, which corresponds to a 95% prediction interval.

  • max_iter (int, optional) – maximum number of iterations for truncated multivariate sampling, default is 10. Increase this value if number of accepted parameter samples is lower than n.

  • **kwargs – Additional keyword arguments are passed to the ml.simulate() method. For example, tmin and tmax can be passed as keyword arguments to compute the prediction interval for a specific period.

Returns:

data – DataFrame of length number of observations and two columns labeled 0.025 and 0.975 (numerical values) containing the 2.5% and 97.5% prediction interval (for alpha=0.05)

Return type:

Pandas.DataFrame

Notes

Add residuals assuming a Normal distribution with standard deviation equal to the standard deviation of the residuals.