Random links to elaborate on how I built my own Mpv config.
A few weeks ago I discussed the Cochran-Mantel-Haenszel test. Another widely used test to assess linear trend in two-way tables is the Mantel-Haenszel trend test. There’s a very interesting discussion about trend tests on Stata FAQs, by William Sribney from StataCorp.
A few weeks ago I came across this blog post: Approximating sin(x).
It functions very similarly to the taylor polynomial, except the constants have been replaced to achieve greather accuracy, (…)
Except this is not based on a Taylor expansion, but it rather relies on Chebyshev polynomials.
In Polynomial Approximations to Elementary Functions
Elementary Functions and Approximate Computing, see also Computing Machine-Efficient Polynomial Approximations
Remez algorithm, see Dandelion: Certified Approximations of Elementary Functions
In a previous post, I mention a way to suffle labels of a two-group dataset in order to carry out a permutation test. Usually, it’s more efficient to randomize the highest level unit of an experimental design, i.e. rather than shuffling observations use the group level.
A recursive solution to the problem of generating all permutation of a given list or array is as follows:
If the length of Permutation equals the length of Array
Permutation Found.
Else
For each position ‘p’ from 0 till the length of Array
If element at position ‘p’ has been taken
Continue to check for next position.
Mark position ‘p’ as Taken.
Append the element at position ‘p’ to the Permutation.
Generate_Permutation ( Permutation, Array, Positions )
Remove the element at position ‘p’ from the Permutation.
Mark position ‘p’ as Available.
other algorithms
heap
domain-specific applications https://rdrr.io/cran/permute/
Sedgewick and Wayne’s algorithm https://introcs.cs.princeton.edu/java/23recursion/Permutations.java.html
https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm
base case
Racket
cl-permutation
Rosetta code
numpy and itertools.permutations()
, https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.permutation.html#numpy.random.Generator.permutation
next permutation https://www.nayuki.io/page/next-lexicographical-permutation-algorithm
stream, generator
Phillip Good (2004) Permutation, Parametric, and Bootstrap Tests of Hypotheses, New York: Springer-Verlag
♪ Sixth June • Night Before