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
function test( )
m = 100
data = rand( Normal( -3, 7 ), m )
m = Model( solver = SCSSolver( ) ) @defvar(m, μ, start = 0.0)
@setObjective(m, Min, sum{(data[i]-μ)^2, i=1:m})
solve(m)
println("μ = ", getValue(μ))
end
So I can rule out the solver/non linearity as the source of the error. I don't get an error when using this:
@setObjective(m, Min, 2μ)
in the test() function.
Here are the julia infos:
Julia Version 0.4.0-rc1
JuMP 0.10.2
NLopt 0.2.3
SCS 0.0.9
And the full error message:
ERROR: LoadError: MethodError: colon has no method matching colon(::Int32, ::JuMP.Model)
Closest candidates are:
colon{T<:Real}(::T<:Real, ::Any, ::T<:Real)
colon{A<:Real,C<:Real}(::A<:Real, ::Any, ::C<:Real)
colon{T}(::T, ::Any, ::T)
...
[inlined code] from /home/...julia/v0.4/JuMP/src/v0.4/parseExpr_staged.jl:325
in testc at /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl:99
in main at /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl:113
in include at ./boot.jl:260
in include_from_node1 at ./loading.jl:271
while loading /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl, in expression starting on line 117
The text was updated successfully, but these errors were encountered:
Hi,
I get the following error when using sum{...} in @setObjective():
ERROR: LoadError: MethodError:
colon
has no method matching colon(::Int32, ::JuMP.Model)when trying to reproduce the mle.jl example. Here is the code:
function gauss( )
m = 100
data = rand( Normal( -3, 7 ), m )
m = Model( solver = NLoptSolver( algorithm = :LD_MMA ) )
@defvar(m, μ, start = 0.0)
@defvar(m, σ >= 0.0, start = 1.0)
@setNLObjective(m, Max, (m/2)_log(1/(2π_σ^2))-sum{(data[i]-μ)^2, i=1:m}/(2σ^2))
solve(m)
println("μ = ", getValue(μ))
println("mean(data) = ", mean(data))
println("σ^2 = ", getValue(σ)^2)
println("var(data) = ", var(data))
println("MLE objective: ", getObjectiveValue(m))
end
And I get the same error when running this:
function test( )
m = 100
data = rand( Normal( -3, 7 ), m )
m = Model( solver = SCSSolver( ) )
@defvar(m, μ, start = 0.0)
@setObjective(m, Min, sum{(data[i]-μ)^2, i=1:m})
solve(m)
println("μ = ", getValue(μ))
end
So I can rule out the solver/non linearity as the source of the error. I don't get an error when using this:
@setObjective(m, Min, 2μ)
in the test() function.
Here are the julia infos:
Julia Version 0.4.0-rc1
And the full error message:
ERROR: LoadError: MethodError:
colon
has no method matching colon(::Int32, ::JuMP.Model)Closest candidates are:
colon{T<:Real}(::T<:Real, ::Any, ::T<:Real)
colon{A<:Real,C<:Real}(::A<:Real, ::Any, ::C<:Real)
colon{T}(::T, ::Any, ::T)
...
[inlined code] from /home/...julia/v0.4/JuMP/src/v0.4/parseExpr_staged.jl:325
in testc at /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl:99
in main at /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl:113
in include at ./boot.jl:260
in include_from_node1 at ./loading.jl:271
while loading /home/.../Dropbox/Programming/Languages/julia/mathProgramming/cP/estimtion.jl, in expression starting on line 117
The text was updated successfully, but these errors were encountered: