I’ve been trying to use a constraint that uses Distribution.cdf() in optimization using JuMP. An example of this usage would be similar to the below code.
model = JuMP.Model(NLopt.Optimizer);
set_optimizer_attribute(model, "algorithm", :LD_SLSQP);
@variable(model, x[1:11]);
@constraint(model, c2, Distributions.cdf(Normal(),x[1]) >= 0);
But this produces the error
ERROR: MethodError: no method matching cdf(::Normal{Float64}, ::VariableRef)
Closest candidates are:
cdf(::UnivariateDistribution, ::AbstractArray)
@ Distributions deprecated.jl:103
cdf(::Normal, ::Real)
@ Distributions C:\Users\gperera@ltu.edu.au\.julia\packages\Distributions\SUTV1\src\univariates.jl:637
Stacktrace:
[1] macro expansion
@ C:\Users\gperera@ltu.edu.au\.julia\packages\MutableArithmetics\NIXlP\src\rewrite.jl:321 [inlined]
[2] macro expansion
@ C:\Users\gperera@ltu.edu.au\.julia\packages\JuMP\D44Aq\src\macros.jl:717 [inlined]
[3] top-level scope
@ Untitled-1:34
Any help would be appreciated! Thanks!