calculate.layer.contribution: Calculate layer contribution

View source: R/model.comparison.R

calculate.layer.contributionR Documentation

Calculate layer contribution

Description

calculate.layer.contribution

Usage

calculate.layer.contribution(conStruct.results, data.block, layer.order = NULL)

Arguments

conStruct.results

The list output by a conStruct run for a given MCMC chain.

data.block

A data.block list saved during a conStruct run.

layer.order

An optional vector giving the order in which the layers of conStruct.results are read.

Details

This function takes the results of a conStruct analysis and calculates the relative contributions of each layer to total covariance.

This function calculates the contribution of each layer to total covariance by multiplying the within-layer covariance in a given layer by the admixture proportions samples draw from that layer. The relative contribution of that layer is this absolute contribution divided by the sum of those of all other layers. A layer can have a large contribution if many samples draw large amounts of admixture from it, or if it has a very large within-layer covariance parameter (phi), or some combination of the two. Layer contribution can be useful for evaluating an appropriate level of model complexity for the data (e.g., choosing a value of K or comparing the spatial and nonspatial models).

Value

This function returns a vector giving the relative contributions of the layers in the analysis.


conStruct documentation built on March 31, 2023, 10:13 p.m.