AMPL を使用して最尤推定問題をコーディングしようとしていますが、制約EQC をコーディングする方法がわかりません。制約が 1 つだけ必要なのか、それらのシステム (各プレイヤーに 1 つ) が必要なのかわかりません。制約は固定小数点反復です。以下のコードを投稿しました。
#A constrained optimization formulation for maximum likelihood estimation
# of a interaction game with Incomplete Information
#SET up #
param n;
set P := 1..n; # set of players:
set A := 0..1; # set of actions: adopt is indexed by 1; not adopt is indexed by 0
param nG; # number of groups in the data
set G := 1..nG; # G is the set of groups
param x {g in G, i in P};
param d {g in G, i in P};
オプティマイザによって解決される変数
var alpha >= -100, <= 100; #alpha is to be estimated
var beta >= -100, <= 100; # beta is to be estimated
var p {g in G, i in P} >=0, <=1; #probability of choosing action A=1, to be estimated
目的関数と制約:
maximize Likelihood: sum {g in G, i in P} log(d[g,i]*p[g,i] + (1-d[g,i])*(1-p[g,i]));
subject to EQC {g in G, i in P}: p[g,i] = 1/(1+exp( x[g,i]*alpha + (1/n-1)(sum{g in G, i in P} (p[g,-i]))*beta)) ;
#equilibrium constraint where the probability of taking action A=1 is given by the logit of linear function of alpha,beta,p -> p[g,-i] is probability of A=1 for all other player's excluding i
どうもありがとう