Any ideas on why the attached sheet bombs? The error is (of course) "This variable is undefined", but I have been using MC long enough now to know that when you get that error in a solve block the absolute last thing that is likely wrong is that you have an undefined variable. I note that if I remove two of the conditions in the solve block, it works. Maybe this means there is no convergence?
Thanks in advance.
Solved! Go to Solution.
Valery -- thanks for the reply.However, I'm not sure that I follow you. I provide guess values for p that are constant, but the vector values are, themselves, the parameters being optimized in the solve block. As for plotting the function H(p), that doesn't make sense. H takes the vector p as input and provides a scalar output. I'm not exactly sure what you would like for me to plot.
Moe, if You would like to find a maximum of a function with one argument You can plot this function and see this maximum.
I think so.
Moe Szyslak wrote:
But the one argument is actually a vector of (in this case) 28 values.
Can you calculate the value of this function in one point?
The solve block given-find needs a guess value. Can you calculate the value of your function with this guess value?
Valery -- thanks, but that doesn't do it. I, too, found that if I remove one of the constraints the solve block executes. However, this changes the nature of the problem. The vector p is a vector of probabilities and, as such, needs to sum identically to 1. In your attached sheet, I note that it sums to 1.005. If you're tempted to say "close enough", just change the value of mu_p from 0.4 to 0.5 and you'll find that the sum of the vector p is much greater than 1.
I note that I solved this problem in Excel, so I know that there is an optimal solution that satisfies all constraints.