Skip to content

Commit

Permalink
Merge pull request #608 from chriscoey/portexample
Browse files Browse the repository at this point in the history
change JuMP portfolio example to rebalancing
  • Loading branch information
chriscoey authored Oct 21, 2020
2 parents 7350fcf + 88c561c commit 55cb57c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/portfolio/JuMP.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=
see description in native.jl
portfolio rebalancing problem
=#

struct PortfolioJuMP{T <: Real} <: ExampleInstanceJuMP{T}
Expand All @@ -17,9 +17,9 @@ function build(inst::PortfolioJuMP{T}) where {T <: Float64}
gamma = sum(abs, sigma_half * x) / sqrt(num_stocks)

model = JuMP.Model()
JuMP.@variable(model, invest[1:num_stocks] >= 0)
JuMP.@variable(model, invest[1:num_stocks])
JuMP.@objective(model, Max, dot(returns, invest))
JuMP.@constraint(model, sum(invest) == 1)
JuMP.@constraint(model, sum(invest) == 0)

aff_expr = sigma_half * invest
if inst.epipernormeucl_constr
Expand Down
1 change: 1 addition & 0 deletions examples/portfolio/JuMP_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ insts["fast"] = [
((10, true, true),),
((50, true, false),),
((50, false, true),),
((50, false, true), StandardConeOptimizer),
((50, true, true),),
((400, true, false),),
((400, false, true),),
Expand Down

0 comments on commit 55cb57c

Please sign in to comment.