"""Skeleton for Data analysis Fall 2021 sheet 4."""
def linear(x, m, q): # This is just an example of an (extensive) docstring
r"""Calculate the linear function y = m * x + q
The linear function
.. math::
y = m \cdot x + q
is often used a s a simple approximation.
Args:
x (float, array): Input data x
m (float, array): Linear scaling of x
q (float, array): Shift of x
Returns:
float or array: Value of the linear function. Shape is the broadcasted shape of
the inputs.
"""
pass # TODO: implement the linear function.
# This can also be split into exercise 4a, 4b, 4c if you prefer
def ex_4():
"""Run exercise 4."""
# Here is your code for exercise 4.
print("ex4 executed.")
if __name__ == '__main__':
# You can uncomment the exercises that you don't want to run. Here we have just one,
# but in general you can have more.
ex_4()