dkcens2: Density of the chosen kernel

View source: R/dkcens2.R

dkcens2R Documentation

Density of the chosen kernel

Description

Computes likelihood contribution for censored data.

Usage

dkcens2(xleft, xright, c_code_filters, distr = NULL, mu = NULL, sigma = NULL)

Details

For internal use

Examples


## The function is currently defined as
function(xleft, xright, c_code_filters, distr = NULL, mu = NULL,
         sigma = NULL) {
  res <- seq_along(xleft)
  res[c_code_filters[["1"]]] <- dk(
    x = xleft[c_code_filters[["1"]]],
    distr, mu, sigma
  )
  res[c_code_filters[["2"]]] <- pk(
    xright[c_code_filters[["2"]]],
    distr, mu, sigma
  )
  res[c_code_filters[["0"]]] <- 1 - pk(
    xleft[c_code_filters[["0"]]],
    distr, mu, sigma
  )
  res[c_code_filters[["3"]]] <- pk(
    xright[c_code_filters[["3"]]],
    distr, mu, sigma
  ) - pk(
    xleft[c_code_filters[["3"]]],
    distr, mu, sigma
  )
  return(res)
}

konkam/BNPdensity documentation built on March 14, 2024, 7:15 a.m.