Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def foo(x):
  2.     med = [0.16748309770445646,
  3.              0.3358146063190391,
  4.              0.5002394192180806,
  5.              0.6627555994868011,
  6.              0.8335605975220853]
  7.     maxs = [178, 290, 320, 220, 200]
  8.    
  9.     val = 0
  10.     coefs = []
  11.     for i in range(5):
  12.         mu = med[i]
  13.         sigma = 0.055
  14.         val += med[i] * mlab.normpdf(x, mu, sigma) / 7.2501664 * maxs[i]
  15.         coefs += [mlab.normpdf(x, mu, sigma) / 7.2501664 * maxs[i]]
  16.     coefs = np.array(coefs)
  17.     coefs = coefs / coefs.sum()
  18.     return (coefs * med).sum()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement