
Descriptive vs. Inferential Statistics: Understanding the Difference
In this blog post, I explain The Role of Statistics in Data Science - Descriptive vs. Inferential Statistics: Understanding the Difference.
# Let the zeroth value of some_parameter = 3
# Say we have the following relationship
"""
some_parameter{current} = some_parameter{previous} + parameter_2{current} *
(some_parameter{previous} + parameter_1{current})
"""
# column to store result
new_column = 'some_parameter'
# decorator function
def decorator_function(formula_function):
prev_row = {}
def wrapper(curr_row, **kwargs):
value = formula_function(curr_row, prev_row)
prev_row.update(curr_row)
prev_row[new_column] = value
return value
return wrapper
@decorator_function
def some_parameter_computation(curr_row, prev_row):
return round(prev_row.get('some_parameter', 3) +\
curr_row['parameter_2'] * (prev_row.get('some_parameter', 3) -\
curr_row['parameter_1']), 2)