Is there a good math/stats library for Scala? [closed]

Yes, there are some: Scalalab The ScalaLab project aims to provide an efficient scientific programming environment for the Java Virtual Machine. The scripting language is based on the Scala programming language enhanced with high level scientific operators and with an integrated environment that provides a Matlab-like working style. The scripting code is extremely fast, close … Read more

Why is the Fibonacci series used in agile planning poker? [closed]

The Fibonacci series is just one example of an exponential estimation scale. The reason an exponential scale is used comes from Information Theory. The information that we obtain out of estimation grows much slower than the precision of estimation. In fact it grows as a logarithmic function. This is the reason for the higher uncertainty … Read more

Probability to z-score and vice versa

>>> import scipy.stats as st >>> st.norm.ppf(.95) 1.6448536269514722 >>> st.norm.cdf(1.64) 0.94949741652589625 As other users noted, Python calculates left/lower-tail probabilities by default. If you want to determine the density points where 95% of the distribution is included, you have to take another approach: >>>st.norm.ppf(.975) 1.959963984540054 >>>st.norm.ppf(.025) -1.960063984540054

How to efficiently calculate a running standard deviation

The answer is to use Welford’s algorithm, which is very clearly defined after the “naive methods” in: Wikipedia: Algorithms for calculating variance It’s more numerically stable than either the two-pass or online simple sum of squares collectors suggested in other responses. The stability only really matters when you have lots of values that are close … Read more

Calculate mean and standard deviation from a vector of samples in C++ using Boost

I don’t know if Boost has more specific functions, but you can do it with the standard library. Given std::vector<double> v, this is the naive way: #include <numeric> double sum = std::accumulate(v.begin(), v.end(), 0.0); double mean = sum / v.size(); double sq_sum = std::inner_product(v.begin(), v.end(), v.begin(), 0.0); double stdev = std::sqrt(sq_sum / v.size() – mean … Read more

Two-sample Kolmogorov-Smirnov Test in Python Scipy

You are using the one-sample KS test. You probably want the two-sample test ks_2samp: >>> from scipy.stats import ks_2samp >>> import numpy as np >>> >>> np.random.seed(12345678) >>> x = np.random.normal(0, 1, 1000) >>> y = np.random.normal(0, 1, 1000) >>> z = np.random.normal(1.1, 0.9, 1000) >>> >>> ks_2samp(x, y) Ks_2sampResult(statistic=0.022999999999999909, pvalue=0.95189016804849647) >>> ks_2samp(x, z) Ks_2sampResult(statistic=0.41800000000000004, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)