R/ftilde.r

Defines functions ftilde

Documented in ftilde

ftilde <- function(loc, yy, fhat, dy, h, type) {
  # f0tilde
  if (identical(type, 0)) {
    res <- sum(dnorm(yy, loc, h) * fhat) * dy
  }

  # f1tilde
  if (identical(type, 1)) {
    res <- sum(-(loc - yy) * dnorm(yy, loc, h) * fhat) * dy / (h^2)
  }

  # f2tilde
  if (identical(type, 2)) {
    res <- sum((((loc - yy) / h)^2 - 1) * dnorm(yy, loc, h) * fhat) * dy / (h^2)
  }

  return(res)
}

Try the logcondens package in your browser

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

logcondens documentation built on Aug. 22, 2023, 5:06 p.m.