Problem 2
Problem 2
# putting labels
plt.xlabel('x')
plt.ylabel('y')
def main():
# observations / data
x = np.array([1, 2, 3, 4, 5])
y = np.array([1.2, 1.8, 2.6, 3.2, 3.8])
# estimating coefficients
b = estimate_coef(x, y)
print("Estimated coefficients:\nb_0 = {} nb_1 = {}".format(b[0], b[1]))
n = float(input("Input Week Number"))
pr: float = b[0] + b[1] * n
print("sale in Week",n, "will be", pr)
# plotting regression line
plot_regression_line(x, y, b)
if __name__ == "__main__":
main()