fcondXA2: Conditional density evaluation in the fully nonparametric...

View source: R/fcondXA2.R

fcondXA2R Documentation

Conditional density evaluation in the fully nonparametric model

Description

This function evaluates a density path conditionally on a posterior realization of the normalized measure.

Usage

fcondXA2(x, distr, Tauy, Tauz, J)

Details

For internal use.

Examples


## The function is currently defined as
function(x, distr = 1, Tauy, Tauz, J) {
  pJ <- J / sum(J)
  K <- matrix(NA, nrow = length(Tauy), ncol = length(x))
  for (i in seq(Tauy)) {
    K[i, ] <- dk(x, distr = distr, mu = Tauy[i], sigma = Tauz[i])
  }
  fcondXA2 <- apply(K, 2, function(x) sum(x * pJ))
  return(fcondXA2)
}

BNPdensity documentation built on April 1, 2023, 12:10 a.m.