get_mixing_weights: Extractor for estimated mixing weights

View source: R/extractors.R

get_mixing_weightsR Documentation

Extractor for estimated mixing weights

Description

Extracts the estimated mixing weights from fitted objects of class admix_estim, gaussianity_test and orthobasis_test.

Usage

get_mixing_weights(x)

Arguments

x

An object of class admix_estim, gaussianity_test or orthobasis_test.

Details

This is a generic extractor. The exact behavior depends on the class of the input object:

  • admix_estim: returns the estimated mixture proportions.

  • gaussianity_test, orthobasis_test: returns weights derived from hypothesis testing results.

Value

A numeric vector of estimated mixing weight(s).

Author(s)

Xavier Milhaud xavier.milhaud.research@gmail.com

Examples

## Simulate a two-component Gaussian mixture:
mixt1 <- twoComp_mixt(n = 380, weight = 0.7,
                      comp.dist = list("norm", "norm"),
                      comp.param = list(list("mean" = -2, "sd" = 0.5),
                                        list("mean" = 0, "sd" = 1)))
data1 <- get_mixture_data(mixt1)
admixMod1 <- admix_model(knownComp_dist = mixt1$comp.dist[[2]],
                         knownComp_param = mixt1$comp.param[[2]])
## Estimate the unknown quantities:
x <- admix_estim(samples = list(data1), admixMod = list(admixMod1), est_method = "BVdk")
## Extract the information about the known component:
get_mixing_weights(x)


admix documentation built on Jan. 8, 2026, 5:07 p.m.