R/line.searcher.r

Defines functions line.searcher

Documented in line.searcher

# function to conduct line search for optimal step length
line.searcher <- function(
                        Base.weight,
                        Co.x,
                        Tr.total,
                        coefs,
                        Newton,
                        ss)
 {
    weights.temp <- c(exp(Co.x %*% (coefs - (ss * Newton) )))
    #weights.temp[is.infinite(weights.temp)] <- 100
    weights.temp <- weights.temp * Base.weight
    Co.x.agg     <- c(weights.temp %*% Co.x)
    maxdiff      <- max(abs(Co.x.agg-Tr.total))
    return(maxdiff)
}

Try the ebal package in your browser

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

ebal documentation built on June 9, 2022, 9:05 a.m.