reset; option randseed''; ############# 1. Simulierte Marktsituationen ############## param B := 5000; # Anzahl Beobachtungen param price {1..B} := round(Uniform(1,20),1); # Angebotspreis param C := 5; # Anzahl Competitors param comp {1..B,c in 1..C}:= round(Uniform(1,20),1); # Preise Competitors param rank {i in 1..B} := 1+card({c in 1..C:comp[i,c]=4 then 1) else if m=7 then (price[i] - min{c in 1..C} comp[i,c]); var beta {m in 1..M}; # zu schaetzende beta-Koeffizienten var P {i in 1..B} = exp(sum{m in 1..M} beta[m]*x[i,m]) /(1+exp(sum{m in 1..M} beta[m]*x[i,m])); # logit W'keit subject to logMLE {m in 1..M}: sum{i in 1..B} ( y[i] - P[i] ) * x[i,m] = 0; # logit Optimalitaetsbedingungen var LL = sum{i in 1..B} ( y[i]*log(P[i]) + (1-y[i])*log(1-P[i]) ); # log-likelihood Funktion ############# 4. Goodness of fit ############## var AIC = -2*LL + 2*M; # AIC param AIC0 default 0; param LL0 default 1; param MCF0 default 0; var MCF = 1-LL/LL0; let M:=1; solve; let LL0 := LL; let MCF0 := 1-LL/LL0; let AIC0 := -2*LL0 +2*1; display beta,AIC0,LL0,MCF0; let M:=5; solve; display beta,AIC,LL,MCF; param P_ori {i in 1..20} := if rank[i]=1 then cc1 else if rank[i]=2 then cc2 else if rank[i]=3 then cc3 else 0; param P_est {i in 1..20}; for {i in 1..20} let P_est[i]:=P[i]; display P_ori, P_est; ############# 5. Preisoptimierung ############## param N default 1; # Anzahl neue Beobachtungen param pc {i in 1..N,c in 1..C}:= round(Uniform(1,20),1); # Preise Competitors set A := union {i in 1..20 by 0.1} {round(i,1)}; # set of admissible prices param rank2 {a in A,i in 1..N} := 1+card({c in 1..C:pc[i,c]=4 then 1) else if m=7 then (a - min{c in 1..C} pc[i,c]); param bet {m in 1..M}; for {m in 1..M} let bet[m]:=beta[m]; param P_est2 {a in A,i in 1..N} := exp(sum{m in 1..M} bet[m]*xa[a,i,m]) /(1+exp(sum{m in 1..M} bet[m]*xa[a,i,m])); # logit W'keit für offer price a param Ga {a in A} := P_est2[a,N]*a; # expected profits for situation N param G_opt{i in 1..N} := max{a in A} P_est2[a,i]*a; # expected profits for situation i param a_dd{i in 1..N} := max{a in A: P_est2[a,i]*a = G_opt[i]} a; # best price for situation i display P_ori2, P_est2,Ga; # teste Güte der geschätzten Verkaufsw'keiten display pc; # Marktsituation N display G_opt,a_dd; # bester Preis + erwarteter Gewinn für situation N ############# 6. Performance Messung ############## param a_rand{i in 1..N} := round(Uniform(1,20),1); # rule-based price strategies param a_r1 {i in 1..N} := min{c in 1..C} pc[i,c]; param a_r2 {i in 1..N} := min(min{c in 1..C:a_r1[i]