You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to solve a optimisation problem which need invoking the CDF function of a normal distribution. I use the following code.
`using Convex, Distributions
a = Variable(10, 1)
var = A * a
cdf.(Normal(0, sigma), var)`
But it returns the error below
`MethodError: no method matching iterate(::Convex.MultiplyAtom)
Closest candidates are:
iterate(!Matched::Core.SimpleVector) at essentials.jl:603
iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:603
iterate(!Matched::ExponentialBackOff) at error.jl:253
...
Stacktrace:
[1] copyto!(::Array{Any,1}, ::Convex.MultiplyAtom) at ./abstractarray.jl:721
[2] _collect(::UnitRange{Int64}, ::Convex.MultiplyAtom, ::Base.HasEltype, ::Base.HasLength) at ./array.jl:609
[3] collect(::Convex.MultiplyAtom) at ./array.jl:603
[4] broadcastable(::Convex.MultiplyAtom) at ./broadcast.jl:665
[5] broadcasted(::Function, ::Normal{Float64}, ::Convex.MultiplyAtom) at ./broadcast.jl:1236
[6] top-level scope at In[58]:1
`
I guess the error is due to the cdf expression not supported in Convex.jl. Is there an solution to this issue.
Thank you in advance.
The text was updated successfully, but these errors were encountered:
The CDF of the standard normal distribution is given by the error function, which is concave on positive numbers and convex on negative numbers, so it couldn’t be supported for all numbers, but maybe it could be for those with a definite sign. I’m not really sure how, though. Do you know if this is supported in CVX or CYXPY for example?
One thing to know is Convex.jl is focused on disciplined convex optimization (see http://cvxr.com/dcp/) which efficient global solutions to optimization problems but not all problems can be formulated in this framework. If you don’t need globally optimal solutions, you could try local methods like Optim.jl or the IPOPT solver with JuMP.jl.
I was trying to solve a optimisation problem which need invoking the CDF function of a normal distribution. I use the following code.
`using Convex, Distributions
a = Variable(10, 1)
var = A * a
cdf.(Normal(0, sigma), var)`
But it returns the error below
`MethodError: no method matching iterate(::Convex.MultiplyAtom)
Closest candidates are:
iterate(!Matched::Core.SimpleVector) at essentials.jl:603
iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:603
iterate(!Matched::ExponentialBackOff) at error.jl:253
...
Stacktrace:
[1] copyto!(::Array{Any,1}, ::Convex.MultiplyAtom) at ./abstractarray.jl:721
[2] _collect(::UnitRange{Int64}, ::Convex.MultiplyAtom, ::Base.HasEltype, ::Base.HasLength) at ./array.jl:609
[3] collect(::Convex.MultiplyAtom) at ./array.jl:603
[4] broadcastable(::Convex.MultiplyAtom) at ./broadcast.jl:665
[5] broadcasted(::Function, ::Normal{Float64}, ::Convex.MultiplyAtom) at ./broadcast.jl:1236
[6] top-level scope at In[58]:1
`
I guess the error is due to the cdf expression not supported in Convex.jl. Is there an solution to this issue.
Thank you in advance.
The text was updated successfully, but these errors were encountered: