mut {AVGAS} | R Documentation |
Performing mutation
Description
This function performs mutation which only stores all fitted models without making any comparison. The selected indices in each fitted model will be automatically re-ordered so that main effects comes first, followed by two-way interaction effects, and zero reservation spaces.
Usage
mut(
parents,
heredity = "Strong",
nmain.p,
r1,
r2,
interaction.ind = NULL,
interonly = "No",
aprob = 0.9,
dprob = 0.9,
aprobm = 0.1,
aprobi = 0.9,
dprobm = 0.9,
dprobi = 0.1
)
Arguments
parents |
A numeric matrix of dimension |
heredity |
Whether to enforce Strong, Weak, or No heredity. Default is "Strong". |
nmain.p |
A numeric value that represents the total number of main effects
in |
r1 |
A numeric value indicating the maximum number of main effects. |
r2 |
A numeric value indicating the maximum number of interaction effects. |
interaction.ind |
A two-column numeric matrix containing all possible
two-way interaction effects. It must be generated outside of this function
using |
interonly |
Whether or not to consider fitted models with only two-way interaction effects. A “Yes" or "No" logical vector. Default is "No". |
aprob |
A numeric value between 0 and 1, defined by users. The addition probability during mutation. Default is 0.9. |
dprob |
A numeric value between 0 and 1, defined by users. The deletion probability during mutation. Default is 0.9. |
aprobm |
A numeric value between 0 and 1, defined by users. The main effect addition probability during addition. Default is 0.1. |
aprobi |
A numeric value between 0 and 1, defined by users. The interaction effect addition probability during addition. Default is 0.9. |
dprobm |
A numeric value between 0 and 1, defined by users. The main effect deletion probability during deletion. Default is 0.9. |
dprobi |
A numeric value between 0 and 1, defined by users. The interaction effect deletion probability during deletion. Default is 0.1. |
Value
A numeric matrix single.child.mutated
is returned. Each row representing
a fitted model, and each column corresponding to the predictor index in the fitted model.
Duplicated models are allowed.
See Also
Examples
# Under Strong heredity, interonly = "No"
set.seed(0)
nmain.p <- 4
interaction.ind <- t(combn(4,2))
X <- matrix(rnorm(50*4,1,0.1), 50, 4)
epl <- rnorm(50,0,0.01)
y <- 1+X[,1]+X[,2]+X[,1]*X[,2]+epl
p1 <- initial(X, y, nmain.p = 4, r1 = 3, r2 = 3,
interaction.ind = interaction.ind, q = 5)
m1 <- mut(p1, nmain.p = 4, r1 = 3, r2 = 3,
interaction.ind =interaction.ind)
# Under Strong heredity, interonly = "Yes"
m2 <- mut(p1, heredity = "No", nmain.p = 4, r1 = 3, r2 = 3,
interaction.ind =interaction.ind, interonly = "Yes")