我正在尝试使用AMPL编码最大似然估计问题,并且不确定如何编码约束 EQC。我不确定我是否只需要一个约束或一个系统(每个玩家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
非常感谢Stackoverflow