aliquote.org

lost+found 2024

January 1, 2025

Customizing Mpv (2024-08-21)

Random links to elaborate on how I built my own Mpv config.

On trend tests (2024-01-25)

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.

Approximating sine (2024-01-25)

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

Generating all or next permutation (2024-01-12)

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.

Phillip Good (2004) Permutation, Parametric, and Bootstrap Tests of Hypotheses, New York: Springer-Verlag

♪ Sixth June • Night Before

See Also

» lost + found 2023 » Recently on the commonplace book » 15 years and 600 posts » lost+found 2021 » Three years micro-blogging