rfystar: Conditional posterior distribution of the distinct Ystar

View source: R/rfystar.R

rfystarR Documentation

Conditional posterior distribution of the distinct Ystar

Description

This function evaluates the ratio of conditional posterior distributions of the distinct latents Ystar.

Usage

rfystar(v, v2, x, distr.k, sigma.k, distr.p0, mu.p0, sigma.p0)

Details

For internal use.

Examples


## The function is currently defined as
function(v, v2, x, distr.k, sigma.k, distr.p0, mu.p0, sigma.p0) {
  alpha <- p0(v, distr = distr.p0, mu = mu.p0, sigma = sigma.p0) /
    p0(v2, distr = distr.p0, mu = mu.p0, sigma = sigma.p0)
  Prod <- 1
  for (i in seq(length(x))) {
    fac <- dk(x[i], distr = distr.k, mu = v, sigma = sigma.k) /
      dk(x[i], distr = distr.k, mu = v2, sigma = sigma.k)
    Prod <- Prod * fac
  }
  f <- alpha * Prod
  return(f)
}

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