Hi, this is my first time using the proc optmodel function and I am wondering if anyone could kindly help me with it. I am trying to solve for a and b that minimize Npv = (o1-i1)/(1+f1+m1*b+a) + (o2-i2)/((1+f1+m1*b+a)*(1+f2+m2*b+a)). o1 and o2 are the first two columns of out. i1 and i2 are the first two columns of in. f1 and f2 are the first two columns of rf. m1 and m2 are the first two columns of rm. Below is my code so far and I have no idea about the correct code for the minimization problem. Proc Optmodel;
Set<String> Property;
Set Ouf = 1..5;
Set Inf = 1..5;
Set Rfr = 1..5;
Set Mkt = 1..5;
Number out {Property,ouf};
Number in {Property,inf};
Number rf {Property,rfr};
Number rm {Property,mkt};
Read Data Tst3 Into Property=[Prop] {o in ouf}<Out[Prop,o]=col("o"||o)>;
Read Data Tst3 Into Property=[Prop] {i in inf}<In [Prop,i]=col("i"||i)>;
Read Data Tst3 Into Property=[Prop] {f in inf}<Rf [Prop,f]=col("f"||f)>;
Read Data Tst3 Into Property=[Prop] {m in inf}<Rm [Prop,m]=col("m"||m)>;
Var a,b;
Quit; I tried the code below but that's apparently wrong. I would really appreciate your help. Min Npv = (Out[o]-In[i])/(1+rf[f]+rm[m]*b+a);
... View more