-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backtraces for nonlinear expressions #441
Comments
Related to #320 |
Below is a code example. It is supposed to solve an asymmetric auction with collocation methods. In this case the inverses of the optimal bidding strategies are approximated with simple polynomials. The code terminates with WARNING: Ipopt finished with status Invalid_Number_Detected One possible source of this is the fact that a truncated weibull distribution (the distribution of cost draws) is evaluated. But the expression for the pdf/cdf might not be defined for x outside of [ll,uu]. That is why I am imposing some constraints on the argument (in this case constraints on non-linear expressions) but I am not sure whether these constraints are allowed to be violated, in which case this might be the source of the error. Not sure whether this is a useful example. |
using JuMP Hypergeometric Distributionfunction hyperprob(NL,NH,m,k)
end; Define parameters of weibull distributions + number of firmsnpoints = 300; # number of points for which we measure deviation at FOC M = 5 # M = number of firms + 1 Define probabilities of firm compositioncL = zeros(NL+NH-1,NL+NH) define probability weights on number of competitorsh = rand(M-1) define jump modelm = Model() @defvar(m, 0.0000 <= alphaL[1:npoly] <= 5.0); for i = 1:npoly define endogenous grid of player L and H@defNLExpr(psetL[j=1:npoints],plowerL + ((j-1)(uu-plowerL))/(npoints-1)); define the inverse bidding function as well as it's derivative of player L@defNLExpr(betainvL[j=1:npoints],plowerL + alphaL[1]+sum{alphaL[k](psetL[j]-plowerL)^(k-1),k=2:npoly}); define the inverse bidding function as well as it's derivative of player H@defNLExpr(betainvH[j=1:npoints],plowerH + alphaH[1]+sum{alphaH[k](psetH[j]-plowerH)^(k-1),k=2:npoly}); @addNLConstraint(m, mbetainvLC[i=1:npoints], ll <= betainvL[i] <= uu); truncated weibull pdf evaluated at inverse bidding function@defNLExpr(wL[i=1:npoints],((aparamL/lparamL)_((betainvL[i]/lparamL)^(aparamL-1))exp(-((betainvL[i]/lparamL)^aparamL)))/(exp(-((ll/lparamL)^aparamL))-exp(-((uu/lparamL)^aparamL)))); truncated weibull cdf evaluated at inverse bidding function@defNLExpr(WL[i=1:npoints],(exp(-((ll/lparamL)^aparamL))-exp(-((betainvL[i]/lparamL)^aparamL)))/(exp(-((ll/lparamL)^aparamL))-exp(-((uu/lparamL)^aparamL)))); expressions that make up FOC of player L and H@defNLExpr(psi1L[i=1:npoints],sum{h[m]sum{cL[m,k+1](WL[i]^k)(WH[i]^(m-k)),k=0:m},m=1:NL+NH-1}); @defNLExpr(psi2L[i=1:npoints],(psetL[i]-betainvL[i])_sum{h[m]sum{(k_wL[i]cL[m,k+1](WL[i]^(k-1))(WH[i]^(m-k)))/(0.0001+dbetainvL[i]),k=1:m},m=1:NL+NH-1}); @defNLExpr(psi3L[i=1:npoints],(psetL[i]-betainvL[i])_sum{h[m]_sum{((m-k)wH[i]cL[m,k+1](WL[i]^(k))(WH[i]^(m-k-1)))/(0.0001+dbetainvH[i]),k=0:m-1},m=1:NL+NH-1}); @defNLExpr(betainvHighL,plowerL + alphaL[1]+sum{alphaL[k](uu-plowerL)^(k-1),k=2:npoly}); @defNLExpr(betainvLowL,plowerL + alphaL[1]); expressions that make up FOC of player H@setNLObjective(m,Min, (sum{(psi1L[i]-psi2L[i]-psi3L[i])^2,i=1:npoints}+sum{(psi1H[i]-psi2H[i]-psi3H[i])^2,i=1:npoints}+ npoints_(betainvHighL-uu)^2 + npoints_(betainvHighH-uu)^2 + npoints_(betainvLowL-ll)^2 + npoints_(betainvLowH-ll)^2)/10000000) |
I think this issue went away with the NLP rewrite? |
They don't currently work.
The text was updated successfully, but these errors were encountered: