ecos_fit: Fitting Grade of Membership model for clustering into...

Description Usage Arguments Value Examples

View source: R/ecos_fit.R

Description

A grade of membership model for clustering a site by features data - which could be presence-absence or counts abundance data of species in the sites.

Usage

1
2
3
4
5
6
7
8
ecos_fit(
  dat,
  max_dat = NULL,
  K,
  tol = 0.1,
  num_trials = 1,
  fit_control = list()
)

Arguments

dat

input data matrix of samples along rows and features along sites, with each entry a 0/1 signififying presence/absence or counts of abundances.

K

The number of clusters to fit

tol

The tolerance level of the model.

num_trials

Number of EM runs from different starting points. This is' key for picking the best fit model across multiple runs.

fit_control

The control parameters for the model.

Value

Returns a model fit with omega as cluster membership probabilities and theta as cluster feature matrix.

Examples

1
2
3
4
5
6
data("himalayan_birds")
species_abundance_counts <- t(exprs(himalayan_birds));
fit <- ecostructure_fit(species_abundance_counts, K = 2, tol = 0.1)
species_pa_counts <- species_abundance_counts
species_pa_counts[species_pa_counts >=1] = 1
fi2 <- ecos_fit(species_pa_counts, K = 2, tol = 0.1)

kkdey/ecostructure documentation built on Jan. 26, 2021, 4:10 p.m.