get_prior_weights: Compute priors on the mixing weights of each candidate latent...

View source: R/main_wrappers.R

get_prior_weightsR Documentation

Compute priors on the mixing weights of each candidate latent class.

Description

This is the third step of the CLIMB procedure. It is useful because one can eliminate latent classes whose prior weights are too small. This function is parallelizable.

Usage

get_prior_weights(reduced_classes, fits, parallel = FALSE, ncores = 20, delta = NULL)

Arguments

reduced_classes

Matrix output from get_reduced_classes.

fits

Fits output from get_pairwise_fits.

parallel

Boolean. Should this function be parallelized?

ncores

If parallel=TRUE, how many cores should this be parallelized over?

delta

Which value of integer tuning parameters delta should be checked? Defaults to 0:choose(D,2)

Value

List of vectors. Each element of the list is a vector corresponds to the computed prior weights for a given value delta.

Author(s)

hbk5086@psu.edu

Examples

data(sim)
data(fits)

#------------------------------------------------------------
# Not run:
#
# D <- ncol(sim$data)  
# reduced_classes <- get_reduced_classes(fits, D, "lgf.txt")
# prior_weights <- get_prior_weights(reduced_classes, fits, parallel = FALSE)
# plot(
#    seq_along(prior_weights)-1,
#    sapply(prior_weights, function(X)
#    sum(X * n > D)),
#    ylab = "number of retained classes",
#    xlab =  expression(delta))
#------------------------------------------------------------

hillarykoch/CLIMB documentation built on Oct. 24, 2022, 4:27 a.m.