R/calc.zerocoef.R

calc.zerocoef <- function (coef, zeros) {
  new_coef <- matrix(0,1,length(coef))

  for (d in (1:length(coef))) {
    for (i in (d:length(coef))) {
      new_coef[1,d] <- coef[i] * zeros^(i-d) * choose(i-1, d-1) + new_coef[1,d]
    }
  }
  
  new_coef[1,1] <- new_coef[1,1] - zeros
  
  as.numeric(new_coef)
}

Try the ptw package in your browser

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

ptw documentation built on Jan. 19, 2022, 5:07 p.m.