Print a species_mix model object.

# S3 method for species_mix
print(x, ...)

Arguments

x

A model object.

\dots

Ignored

Examples

#Print information about a species_mix model # \donttest{ library(ecomix) set.seed(42) sam_form <- stats::as.formula(paste0('cbind(',paste(paste0('spp',1:20), collapse = ','),")~x1+x2")) sp_form <- ~ 1 beta <- matrix(c(-2.9,-3.6,-0.9,1,.9,1.9),3,2,byrow=TRUE) dat <- data.frame(y=rep(1,100),x1=stats::runif(100,0,2.5), x2=stats::rnorm(100,0,2.5)) dat[,-1] <- scale(dat[,-1]) simulated_data <- species_mix.simulate(archetype_formula = sam_form,species_formula = sp_form, data = dat,beta=beta,family="bernoulli")
#> Random alpha from normal (-1,0.5) distribution
fm1 <- species_mix(archetype_formula = sam_form,species_formula = sp_form, data = simulated_data, family = 'bernoulli', nArchetypes=3)
#> SAM modelling
#> There are 3 archetypes to group the species into
#> There are 100 site observations for 20 species
#> The model for the archetype (grouping) is ~x1 + x2
#> The model for the species is ~1
#> You are implementing a bernoulli Species Archetype Model.
#> Using ECM algorithm to find starting values; using 1 refits
#> ECM restart 1 of 1
#> Initialising starting values
#> Initial groups parameter estimates by K-means clustering
#> Iteration: 1 | New loglik -950.729 | Ratio loglik 0
#> Iteration: 2 | New loglik -829.843 | Ratio loglik 0.872849
#> Iteration: 3 | New loglik -820.246 | Ratio loglik 0.988434
#> Iteration: 4 | New loglik -819.839 | Ratio loglik 0.999504
#> initial value 819.837658 #> iter 10 value 819.706575 #> final value 819.703416 #> converged
print(fm1)# }
#> bernoulli species_mix model #> #> Pi #> Archetype1 Archetype2 Archetype3 #> 0.25 0.40 0.35 #> #> Coefficients #> $alpha #> spp1 spp2 spp3 spp4 spp5 spp6 spp7 #> -0.8017227 -1.6402031 -0.5752349 -1.0844096 -1.0206816 -1.1776675 -0.7334905 #> spp8 spp9 spp10 spp11 spp12 spp13 spp14 #> -1.2036925 -1.6417828 -0.1856826 -0.8567273 -1.3909615 -0.7040057 -0.7040057 #> spp15 spp16 spp17 spp18 spp19 spp20 #> -0.8934080 -0.3780058 -1.3858329 -1.0552211 -1.2036925 -0.4298861 #> #> $beta #> x1 x2 #> Archetype1 -2.9107151 -3.5524869 #> Archetype2 -0.8299319 0.9551632 #> Archetype3 0.9916068 1.9873571 #>