fcondXA: Conditional density evaluation in the semiparametric model

Description Usage Details Examples

View source: R/fcondXA.R

Description

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

Usage

1
fcondXA(x, distr, Tau, J, sigma)

Details

For internal use.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## The function is currently defined as
function (x, distr = 1, Tau, J, sigma) 
{
    pJ <- J/sum(J)
    K <- matrix(NA, nrow = length(Tau), ncol = length(x))
    for (i in seq(Tau)) {
        K[i, ] <- dk(x, distr = distr, mu = Tau[i], sigma = sigma)
    }
    fcondXA <- apply(K, 2, function(x) sum(x * pJ))
    return(fcondXA)
  }

BNPdensity documentation built on May 29, 2017, 9:33 p.m.