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: numpy.ndarray¶
- property degree: int¶
the polynomial degree :return:
- property error¶
the error on the polynomial coefficients :return:
- classmethod from_previous_fit(coefficients, covariance) threeML.utils.time_series.polynomial.Polynomial [source]¶
- threeML.utils.time_series.polynomial.polyfit(x: Iterable[float], y: Iterable[float], grade: int, exposure: Iterable[float], bayes: bool = False) Tuple[threeML.utils.time_series.polynomial.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 – teh 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: float, t_stop: float, exposure: float, bayes: bool) Tuple[threeML.utils.time_series.polynomial.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