R/kernel.R

Defines functions kernelpen

Documented in kernelpen

## Copyright (C) 2003 Institut Curie
## Author(s): Philippe Hupé (Institut Curie) 2003
## Contact: glad@curie.fr

## param is a named vector for the parameter of the kernel

kernelpen <- function(x, type = "tricubic", param)
  {
    k <- rep(0,length(x))
    if (type == "tricubic")
      {
        if (missing(param)) stop ("set parameters for your kernel")
        if (length(which(x < 0) > 0)) stop("kernel function is not defined for negative numbers")
        index <- which(x <= param["d"])
        k[index] <- (1 - (x[index] / param["d"])^3)^3
      }
    
    return(k)
    
  }

Try the GLAD package in your browser

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

GLAD documentation built on Nov. 8, 2020, 11:10 p.m.