VOOZH about

URL: https://www.geeksforgeeks.org/python/scipy-stats-cosine-python/

⇱ scipy stats.cosine() | Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

scipy stats.cosine() | Python

Last Updated : 20 Mar, 2019
scipy.stats.cosine() is an cosine continuous random variable that is defined with a standard format and some shape parameters to complete its specification. 👁 Image
Parameters : q : lower and upper tail probability x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 size : [tuple of ints, optional] shape or random variates. moments : [optional] composed of letters [‘mvsk’]; 'm' = mean, 'v' = variance, 's' = Fisher's skew and 'k' = Fisher's kurtosis. (default = 'mv'). Results : cosine continuous random variable
Code #1 : Creating cosine continuous random variable Output :
RV : 
<scipy.stats._distn_infrastructure.rv_frozen object at 0x000001FDC89DEE10>
Code #2 : cosine random variates and probability distribution function. Output:
Random Variates : 
 [ 1.2323289 2.49938238 0.29072394 -1.10925673 0.55881836 1.70470811
 1.29090489 2.64865261 4.32789346 0.14597439]

Probability Distribution : 
 [0.31830193 0.31734797 0.3148134 0.31072354 0.30511926 0.29805655
 0.28960598 0.27985198 0.26889203 0.25683561]
Code #3 : Graphical Representation. Output :
Distribution : 
 [0. 0.06411414 0.12822827 0.19234241 0.25645654 0.32057068
 0.38468481 0.44879895 0.51291309 0.57702722 0.64114136 0.70525549
 0.76936963 0.83348377 0.8975979 0.96171204 1.02582617 1.08994031
 1.15405444 1.21816858 1.28228272 1.34639685 1.41051099 1.47462512
 1.53873926 1.60285339 1.66696753 1.73108167 1.7951958 1.85930994
 1.92342407 1.98753821 2.05165235 2.11576648 2.17988062 2.24399475
 2.30810889 2.37222302 2.43633716 2.5004513 2.56456543 2.62867957
 2.6927937 2.75690784 2.82102197 2.88513611 2.94925025 3.01336438
 3.07747852 3.14159265]
👁 Image
Code #4: Varying Location and Scale
Comment