R/UpBoundTrimError.R

Defines functions UpBoundTrimError

UpBoundTrimError <- function(z, d2, nu){
  # Computes the upper bound of the
  # trimming error when approximate
  # the outer integral by the trapezoidal rule.
  #
  # Input:
  # z: a given value
  # d2: (number of evaluations of the outer
  #     integrand) * (step length)
  # nu: degrees of freedom + positive integer
  #
  # Written by N Ranathunga, September 2020

  x1 <- transf(z)
  x2 <- transf(z + d2)
  term1 <- nu * x1^2
  term2 <- nu * x2^2

  out <- stats::pchisq(term1, df=nu) + 1 -
         stats::pchisq(term2, df=nu)

}

Try the ciuupi2 package in your browser

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

ciuupi2 documentation built on March 11, 2021, 5:06 p.m.