regimeMatrix: Create a matrix that defines models for batch analysis

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/regimes.R

Description

regimeMatrix is a recursive function that returns a matrix of n columns by k rows, where n is a number of items and k is the number of all possible permutations of those items, up to a maximum number of items defined by maxNodes, and including a row with zero items.

Usage

1
2
  regimeMatrix(n, maxNodes)
  

Arguments

n

An integer between 1 and maxNodes

maxNodes

An integer between 1 and n; at n = maxNodes, regimeMatrix will return a matrix of 2^n rows.

Details

Typically, this function is called by regimeVectors, but it may be useful to call this function if you are interested in defining an arbitrary set of models that doesn't include all possible models in the

Value

A matrix of n columns by k rows, where n is a number of items and k is the number of all possible permutations of those items, up to a maximum number of items defined by maxNodes, and including a row with zero items

Note

Use of regimeMatrix or regimeMaker to generate tailored sets of regimes is not currently integrated smoothly with runBatchHansen, but for the time being they can be used to create regimes for manual analysis.

Author(s)

Andrew Hipp ahipp@mortonarb.org

See Also

regimeMaker, paintBranches

Examples

1
2
3
4
5
6
  # allowing all possible permutations of changes at 15 nodes will be quite time-consuming:
  print(paste("Number of models =", dim(regimeMatrix(15,15))[1]))
  # paring that down to all possible permutations of changes at 15 nodes, 
  # up to a maximum of 5 changes, is much more manageable:
  print(paste("Number of models =", dim(regimeMatrix(15,5))[1]))
  

maticce documentation built on May 2, 2019, 6:13 p.m.