SHARE
TWEET

Untitled

a guest Jun 25th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ss_res(X, y, theta):
  2.  
  3.     y_diff=[]
  4.     y_pred = X.dot(theta)
  5.  
  6.     for i in range(0, len(y)):
  7.         y_diff.append((y[i]-y_pred[i])**2)
  8.  
  9.     return np.sum(y_diff)
  10.      
  11. def std_error(X, y, theta):
  12.  
  13.  
  14.     delta = (1/(len(y)-X.shape[1]+1))*(ss_res(X,y,theta))
  15.     matrix1=matrix_power((X.T.dot(X)),-1)
  16.     thing2=thing1*matrix1
  17.     thing3=scipy.linalg.sqrtm(thing2)
  18.  
  19.     res=np.diag(thing3)
  20.     serr=np.reshape(res, (6, 1))
  21.     return serr
  22.  
  23. std_error_array=std_error(X,y,theta)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top