Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. ##Miara asymetrii rozkładu
  2.  
  3. # Współczynnik skośności
  4. def skewness(X):
  5. toReturn = 0
  6. for innerX in X:
  7. toReturn += ((innerX - mean(X))**3)/len(X)
  8. toReturn = toReturn / (stdev**3)
  9. return toReturn
  10.  
  11. # Trzeci moment centralny
  12. def thirdCentralMoment(X):
  13. centralMoment = 0
  14. for innerX in X:
  15. centralMoment += ((innerX - mean(X))**3)
  16. return (Decimal(1/(Decimal(len(X))))*Decimal(centralMoment))
  17.  
  18. # Współczynnik asymetrii
  19.  
  20. def asymmetryCoefficient(X):
  21. return (thirdCentralMoment(X) / Decimal((stdev(X) ** 3)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement