OPTIMIZATION CONSTRAINTS

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

leocaza
Posts: 4
Joined: Mon Nov 27, 2017 7:18 am

OPTIMIZATION CONSTRAINTS

Postby leocaza » Wed Dec 20, 2017 4:27 pm

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

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 7 guests