%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
#vjgdruihdiruhgdiuhj
n=10
x = np.arange(1,n+1,1)
x = x/n
y = np.random.randn(n)*10+30
plt.plot(x,y)
A = np.vander(x,increasing=True)
plt.imshow(A)
A_inv = np.linalg.inv(A)
plt.imshow(A_inv )
plt.imshow(A.dot(A_inv))
c = A_inv.dot(y)
plt.plot(c)
plt.plot(A.dot(c))
n=40
x_ = np.arange(1,n+3,1)
x_ = x_/n
#x_ = x_[np.logical_and(x_>=x.min(), x_<=x.max())]
x_<=x.max()
x
x_
A_ = np.vander(x_,increasing=True)
A_ = A_[:,:len(c)]
plt.imshow(A_)
plt.plot(x_,A_.dot(c))
plt.plot(x,y,"o")