Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Numerical Methods Homework

Views: 706
Kernel: SageMath 8.2
Problem 5
import numpy as np
#find least square line, parabola and cubic # find RMSE # use each to evaluate for 2010 productio level
#same as above #eastimate year 1950
price = np.array([[.59],[.8],[.95],[.45],[.79],[.99],[.90],[.65],[.79],[.69],[.79],[.49],[1.09],[.95],[.79],[.65],[.45],[.60],[.89],[.79],[.99],[.85]]) sales = np.array([[3980],[2200],[1850],[6100],[2100],[1700],[2000],[4200],[2440],[3300],[2300],[6000],[1190],[1960],[2760],[4430],[6960],[4160],[1990],[2860],[1920],[2160]]) fit1 = np.linalg.lstsq(sales,price) ones =np.array([[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]]) # print(A)

Jupyter Kernel terminated: This might be caused by running out of memory or hitting a bug in some library (e.g., forking too many processes, trying to access invalid memory, etc.). Consider restarting or upgrading your project or running the relevant code directly in a terminal to track down the cause, as explained here.