R/bases.R

Defines functions basis_nearby

Documented in basis_nearby

basis_random <- function (n, d = 2) 
{
    mvn <- matrix(rnorm(n * d), ncol = d)
    orthonormalise(mvn)
}

basis_nearby <- function(alpha = 0.75, method = 'geodesic', d = 2)
{
    function (current)
        {
            current <- matrix(current, ncol = d)
            new <- basis_random(nrow(current), d)
            switch(method,
                   linear = orthonormalise((1 - alpha) * current + alpha * new),
                   geodesic = step_fraction(geodesic_info(current, new), alpha))
        }
}

Try the cepp package in your browser

Any scripts or data that you put into this service are public.

cepp documentation built on May 2, 2019, 3:44 p.m.