Learn R Programming

adoptr (version 1.1.1)

make_tunable: Fix parameters during optimization

Description

The methods make_fixed and make_tunable can be used to modify the 'tunability' status of parameters in a TwoStageDesign object. Tunable parameters are optimized over, non-tunable ('fixed') parameters are considered given and not altered during optimization.

Usage

make_tunable(x, ...)

# S4 method for TwoStageDesign make_tunable(x, ...)

make_fixed(x, ...)

# S4 method for TwoStageDesign make_fixed(x, ...)

Value

an updated object of class TwoStageDesign

Arguments

x

TwoStageDesign object

...

unquoted names of slots for which the tunability status should be changed.

See Also

TwoStageDesign, tunable_parameters for converting tunable parameters of a design object to a numeric vector (and back), and minimize for the actual minimzation procedure

Examples

Run this code
design <- TwoStageDesign(25, 0, 2, 25, 2, order = 5)
# default: all parameters are tunable (except integration pivots,
# weights and tunability status itself)
design@tunable

# make n1 and the pivots of n2 fixed (not changed during optimization)
design <- make_fixed(design, n1, n2_pivots)
design@tunable

# make them tunable again
design <- make_tunable(design, n1, n2_pivots)
design@tunable

Run the code above in your browser using DataLab