diff --git a/toarstats/trends/interface.py b/toarstats/trends/interface.py index 138acf1f3a4362dcc56676ce1f23a4e8544649c6..d2787cd80470a5da64f794298361d9e4d76e5243 100644 --- a/toarstats/trends/interface.py +++ b/toarstats/trends/interface.py @@ -1,22 +1,25 @@ """This module contains the public interface for the trends subpackage. This module contains the following function: -calculate_quantile_regression - calculate the quantile regression +calculate_trend - calculate the trend using the requested method """ import statsmodels.formula.api as smf -def calculate_quantile_regression(quantiles, data): - """Calculate the quantile regression. +def calculate_trend(method, data, formula="value ~ datetime", quantiles=None): + """Calculate the trend using the requested method. This function is the public interface for the ``trends`` subpackage. It takes all the user inputs and returns the result of the requested - quantile regression. + trend analysis. - :param quantiles: a single quantile or a list of quantiles to - calculate, these must be between 0 and 1 + :param method: either ``"OLS"`` or ``"quant"`` :param data: data containing a list of date time values and associated parameter values on which to calculate the - quantile regression + trend + :param formula: the formula specifying the model + :param quantiles: a single quantile or a list of quantiles to + calculate, these must be between 0 and 1; only + needed when ``method="quant"`` """