[R] Include a formula using the function “makeParamSet”

Nelly Reduan ne||@redu @end|ng |rom hotm@||@|r
Wed Oct 9 23:30:15 CEST 2019


I am performing Latin Hypercube sampling from functions "makeParamSet" and "generateDesign" (package "ParamHelpers") in R. Using the function "makeParamSet", how can I specify a formula to define a given parameter ? Here is an example where "g� is the product of �a� and �c�:

ps <- makeParamSet(makeIntegerParam("a", lower=800, upper=7200),

                   makeIntegerParam("c", lower=632, upper=5688),

                   makeIntegerParam("e", lower=5, upper=45),

                   makeIntegerParam("b", lower=0, upper=7200),

                   makeIntegerParam("d", lower=0, upper=5688),

                   makeIntegerParam("f", lower=0, upper=45),

                   makeIntegerParam("g", trafo = function(a,c) a*c),

                   forbidden = quote(d > g))

Y <- generateDesign(100, ps, trafo = T)

With the code, I have the following error:

Error in doBasicGenDesignChecks(par.set) :

  Finite box constraints required!

Thank you very much for your help.

	[[alternative HTML version deleted]]

More information about the R-help mailing list