disclapmix2 {disclapmix2}R Documentation

Discrete Laplace mixture inference using Numerical Optimisation

Description

An extension to the *disclapmix* method in the *disclapmix* package that supports duplicated loci and other non-standard haplotypes.

Description of your package

Usage

disclapmix2(
  x,
  number_of_clusters,
  include_2_loci = FALSE,
  remove_non_standard_haplotypes = TRUE,
  use_stripped_data_for_initial_clustering = FALSE,
  initial_y_method = "pam",
  verbose = 0L
)

Arguments

x

DataFrame. Columns should be one character vector for each locus

number_of_clusters

The number of clusters to fit the model for.

include_2_loci

Should duplicated loci be included or excluded from the analysis?

remove_non_standard_haplotypes

Should observations that are not single integer alleles be removed?

use_stripped_data_for_initial_clustering

Should non_standard data be removed for the initial clustering?

initial_y_method

Which cluster method to use for finding initial central haplotypes, y: pam (recommended) or clara.

verbose

Set to 1 (or higher) to print optimisation details. Default is 0.

Value

List.

Author(s)

you

Examples

require(disclapmix)

data(danes) 

x <- as.matrix(danes[rep(seq_len(nrow(danes)), danes$n), -ncol(danes)])
x2 <- as.data.frame(sapply(danes[rep(seq_len(nrow(danes)), danes$n), -ncol(danes)], as.character))


dlm_fit <- disclapmix(x, clusters = 3L)
dlm2_fit <- disclapmix2(x2, number_of_clusters = 3)

stopifnot(all.equal(dlm_fit$logL_marginal, dlm2_fit$log_lik))

[Package disclapmix2 version 0.6.1 Index]