Hi,
I was wondering if there would be a way to set up something similar to the Excel Solver in SAS. i.e. I need to minimize a variable, while respecting certain conditions.
I have a set up below from Excel (problem from Loss Models book) that I'd like to reproduce in SAS. Any ideas or starting points?
The data and the parameters are provided next;
Obs # X Y Z = w1*X + w2*Y
1 0.005 0.004 0.014
2 0.004 0.001 0.007
3 0.059 0.057 0.184
4 0.011 0.005 0.022
5 0.004 0.002 0.008
6 0.016 0.006 0.031
7 0.064 0.039 0.155
8 0.015 0.000 0.018
9 0.033 0.012 0.064
10 0.124 0.001 0.150
11 0.010 0.001 0.014
12 0.014 0.000 0.018
13 0.020 0.007 0.037
14 0.043 0.031 0.115
15 0.025 0.001 0.031
16 0.049 0.023 0.105
17 0.017 0.014 0.048
18 0.005 0.001 0.010
19 0.003 0.001 0.005
*******************************
Parameters Values Description
AVERAGE(X) 0.027 same as in first column
AVERAGE(X)^2 0.001 same as in first column
VAR(X) 0.001 same as in first column
AVERAGE(Y) 0.011 same as in first column
AVERAGE(Y)^2 0.000 same as in first column
VAR(Y) 0.000 same as in first column
COVAR(X,Y) 0.000 same as in first column
a 0.000
where a is:
[AVERAGE(X)^2]*VAR(Y)-AVERAGE(Y) *AVERAGE(X)*COV(X,Y)
b 0.000
where b is:
[AVERAGE(X)^2]*VAR(Y)+[AVERAGE(Y)^2]*VAR(X)-2*AVERAGE(Y)*AVERAGE(X)*COV(X,Y)
phi 0.737 a/b
1-phi 0.263 1-phi
w1 ? solver to find
w2 ? solver to find
AVERAGE(Z) 0.055 same as in first column
VAR(Z) 0.003 solver to minimize
*******************************
Constraint in solver where:
AVERAGE(Z) = w1*AVERAGE(Y) + w2*AVERAGE(X)
Thank you,
c+
I was wondering if there would be a way to set up something similar to the Excel Solver in SAS. i.e. I need to minimize a variable, while respecting certain conditions.
I have a set up below from Excel (problem from Loss Models book) that I'd like to reproduce in SAS. Any ideas or starting points?
The data and the parameters are provided next;
Obs # X Y Z = w1*X + w2*Y
1 0.005 0.004 0.014
2 0.004 0.001 0.007
3 0.059 0.057 0.184
4 0.011 0.005 0.022
5 0.004 0.002 0.008
6 0.016 0.006 0.031
7 0.064 0.039 0.155
8 0.015 0.000 0.018
9 0.033 0.012 0.064
10 0.124 0.001 0.150
11 0.010 0.001 0.014
12 0.014 0.000 0.018
13 0.020 0.007 0.037
14 0.043 0.031 0.115
15 0.025 0.001 0.031
16 0.049 0.023 0.105
17 0.017 0.014 0.048
18 0.005 0.001 0.010
19 0.003 0.001 0.005
*******************************
Parameters Values Description
AVERAGE(X) 0.027 same as in first column
AVERAGE(X)^2 0.001 same as in first column
VAR(X) 0.001 same as in first column
AVERAGE(Y) 0.011 same as in first column
AVERAGE(Y)^2 0.000 same as in first column
VAR(Y) 0.000 same as in first column
COVAR(X,Y) 0.000 same as in first column
a 0.000
where a is:
[AVERAGE(X)^2]*VAR(Y)-AVERAGE(Y) *AVERAGE(X)*COV(X,Y)
b 0.000
where b is:
[AVERAGE(X)^2]*VAR(Y)+[AVERAGE(Y)^2]*VAR(X)-2*AVERAGE(Y)*AVERAGE(X)*COV(X,Y)
phi 0.737 a/b
1-phi 0.263 1-phi
w1 ? solver to find
w2 ? solver to find
AVERAGE(Z) 0.055 same as in first column
VAR(Z) 0.003 solver to minimize
*******************************
Constraint in solver where:
AVERAGE(Z) = w1*AVERAGE(Y) + w2*AVERAGE(X)
Thank you,
c+