Пример #1
0
def duncan_test(table, group_by=None, **params):
    check_required_parameters(_duncan_test, params, ['table'])
    
    params = get_default_from_parameters_if_required(params, _duncan_test)
    param_validation_check = [from_under(params, 0.001, 0.9, 'alpha')]
    validate(*param_validation_check)
    
    if group_by is not None:
        return _function_by_group(_duncan_test, table, group_by=group_by, **params)
    else:
        return _duncan_test(table, **params)
Пример #2
0
def autocorrelation(table, group_by=None, **params):
    check_required_parameters(_autocorrelation, params, ['table'])
    params = get_default_from_parameters_if_required(params, _autocorrelation)
    param_validation_check = [greater_than_or_equal_to(params, 1, 'nlags'),
                              from_under(params, 0.0, 1.0, 'conf_level')]
    validate(*param_validation_check)
    
    if group_by is not None:
        grouped_model = _function_by_group(_autocorrelation, table, group_by=group_by, **params)
        return grouped_model
    else:
        return _autocorrelation(table, **params)
Пример #3
0
def timeseries_decomposition(table, group_by=None, **params):
    len_table = len(table)
    check_required_parameters(_timeseries_decomposition, params, ['table'])
    params = get_default_from_parameters_if_required(
        params, _timeseries_decomposition)
    param_validation_check = [
        from_under(params, 1, len_table, 'frequency'),
        greater_than_or_equal_to(params, 0, 'extrapolate_trend')
    ]
    validate(*param_validation_check)
    if group_by is not None:
        return _function_by_group(_timeseries_decomposition,
                                  table,
                                  group_by=group_by,
                                  **params)
    else:
        return _timeseries_decomposition(table, **params)