Learn R Programming

redist (version 3.1.5)

plans_diversity: Calculate the diversity of a set of plans

Description

Returns the off-diagonal elements of the variation of information distance matrix for a sample of plans, which can be used as a diagnostic measure to assess the diversity of a set of plans. If there are many values close to zero, then the sample has many similar plans and may not be a good approximation to the target distribution.

Usage

plans_diversity(plans, n_max = 100, ncores = 1)

Arguments

plans

a redist_plans object.

n_max

the maximum number of plans to sample in computing the distances. Larger numbers will have less sampling error but will require more computation time.

ncores

the number of cores to use in computing the distances.

Value

A numeric vector of off-diagonal variation of information distances.

Examples

Run this code
# NOT RUN {
data(iowa)
ia <- redist_map(iowa, existing_plan=cd_2010, pop_tol=0.01)
plans <- redist_smc(ia, 100, silent=TRUE)
hist(plans_diversity(plans))

# }

Run the code above in your browser using DataLab