threeML.utils.time_series.polynomial module
- class threeML.utils.time_series.polynomial.Polynomial(coefficients: Iterable[float], is_integral: bool = False)[source]
Bases:
object
- property coefficients
Gets or sets the coefficients of the polynomial.
- property covariance_matrix: ndarray
- property degree: int
the polynomial degree :return:
- property error
the error on the polynomial coefficients :return:
- classmethod from_previous_fit(coefficients, covariance) Polynomial [source]
- threeML.utils.time_series.polynomial.polyfit(x: Iterable[float], y: Iterable[float], grade: int, exposure: Iterable[float], bayes: bool | None = False) Tuple[Polynomial, float] [source]
function to fit a polynomial to data. not a member to allow parallel computation
- Parameters:
x – the x coord of the data
y – the y coord of the data
grade – the polynomical order or grade
expousure – the exposure of the interval
bayes – to do a bayesian fit or not
- threeML.utils.time_series.polynomial.unbinned_polyfit(events: Iterable[float], grade: int, t_start: Iterable[float], t_stop: Iterable[float], exposure: float, bayes: bool) Tuple[Polynomial, float] [source]
function to fit a polynomial to unbinned event data. not a member to allow parallel computation
- Parameters:
events – the events to fit
grade – the polynomical order or grade
t_start – the start time to fit over
t_stop – the end time to fit over
expousure – the exposure of the interval
bayes – to do a bayesian fit or not