Learn R Programming

SSM (version 1.0.1)

comb: Generate all desired exponent vectors of a given degree.

Description

comb recursively generates all the desired exponent vectors of a given degree and is called by degl to generate the matrix put into the basis slot of the SSM object.

Usage

comb(d, deg, N = choose(d + deg - 1, deg), vec, start = TRUE, parent,
  exclude = list())

Arguments

d

A number. Controls the number of recursions before stopping.

deg

A number. The desired degree of resulting exponent vectors.

N

(optional) A number. Sets the number of exponent vectors that will be generated. If not supplied, all candidate vectors will be generated.

vec

A vector. Stores the current state of the generated vector during recursion.

start

(optional) Logical. A flag used to identify the initial call environment.

parent

(optional) An environment. Stores the environment name of the initializing function call.

exclude

(optional) A list of integer vectors which is used to exclude the generation of undesired exponent vectors. e.g. If 1 is a vector in the list then any generated vector which is non-zero in the first column and zero everywhere else will be thrown away.

Value

A matrix of exponent vectors

Details

This function is called by degl during the process of constructing the objects related to the basis of a smooth supersaturated model. It constructs the first N exponent vectors of degree d, excluding those which are non-zero only in the columns specified by vectors listed in exclude. It operates recursively.