R/calc_epsp.R

Defines functions calc_epsp

calc_epsp <-
  function(transformed_residuals, res_order, aggregator_matrix){
    stopifnot(is.numeric(transformed_residuals),
              is.null(aggregator_matrix) || is.matrix(aggregator_matrix))
    if(is.null(aggregator_matrix)){
      output <- cumsum(transformed_residuals[res_order])/sqrt(length(transformed_residuals))
    } else {
      output <- cumsum(as.vector(transformed_residuals[res_order] %*% aggregator_matrix))/sqrt(ncol(aggregator_matrix))
    }
    return(output)
  }

Try the distfreereg package in your browser

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

distfreereg documentation built on April 4, 2025, 12:30 a.m.