R/silverman.r

Defines functions silverman

Documented in silverman

#' Silverman's rule of thumb
#' 
#' A simple Silverman's rule of thumb bandwidth calculation.
#' 
#' @param d Number of dimension
#' @param n Number of observation
#' 
#' @return
#' A simple bandwidth choice
#' 
#' @export
#' 
#' @examples
#' silverman(1, 300)
silverman <- function(d, n) {
  return((4 / (d + 2))^(1 / (d + 4)) * n^(-1 / (d + 4)))
}

Try the orthoDr package in your browser

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

orthoDr documentation built on April 30, 2023, 5:12 p.m.