Optimization AMPL:如何对平衡约束进行编码?

Optimization AMPL:如何对平衡约束进行编码?,optimization,mathematical-optimization,nonlinear-optimization,ampl,Optimization,Mathematical Optimization,Nonlinear Optimization,Ampl,我正在尝试使用AMPL编码一个最大似然估计问题,但不确定如何编码约束EQC。我不确定我是否只需要一个合同或一套合同(每个球员一套)。约束是一个定点迭代。我已将代码张贴在下面: #A constrained optimization formulation for maximum likelihood estimation # of a interaction game with Incomplete Information #SET up # param n; set P := 1.

我正在尝试使用AMPL编码一个最大似然估计问题,但不确定如何编码约束EQC。我不确定我是否只需要一个合同或一套合同(每个球员一套)。约束是一个定点迭代。我已将代码张贴在下面:

#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