Page 1 of 1

OPTIMIZATION CONSTRAINTS

Posted: Wed Dec 20, 2017 4:27 pm
by leocaza
Hi, I am doing an optimization to minimize !y


CODE :
'***********************************************
'***********************************************
subroutine f(scalar !y, scalar !x)
!a=15
!b=40
'Expected return
series er_cad_eq15b_cn = log(cad_d_eq15b_cn(-!x)/cad_seop_cn(-!x))
'Realized return
series rr_cad_eq15b_cn = log(cad_seop_cn/cad_seop_cn(-!x))
!y = @sum((er_cad_eq15b_cn-rr_cad_eq15b_cn))

endsub


scalar in = 0
scalar out = 0
optimize(min) f(out, in)
'***********************************************
'***********************************************

QUESTION :

How to limit the !x between >15 and <=40 as a constraint?


P.S. viewtopic.php?f=4&t=48&p=99 do not help

Thank you