cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED

## Re: Maximize Function: MC 15

 Moe Szyslak wrote:I note that I solved this problem in Excel, so I know that there is an optimal solution that satisfies all constraints.

Hmm. With 28 degrees of freedom to play with there may be many "solutions" that satisfy all the constraints but still don't find the global optimum. See attached for example.

Correction! Myattached file might (or might not) contain the global maximum. My comment in the workfile that your initial guess was better is incorrect. It ignored one of your constraints (the sum of the products of p and P must equal mu.p).

Alan

## Re: Maximize Function: MC 15

Well played, sir. It looks like all you did was change my guess values?

As to not having the global maximum, you may be right -- but, I note that my initial guess (p[i=1/28) did not satisfy the first constraint in the solve block, so it was not a valid solution. Thus, we can't compare your (valid) solution to my (invalid) guess values.

For what it's worth, I am reproducing some published work and I note that this solution "appears" to be consistent with theirs. This is also the solution that I got using Excel.

Thanks!

## Re: Maximize Function: MC 15

If you re-run the file several times (use Ctrl_F9 for example), hence changing the set of initial guesses each time, you'll find that some of the initial sets give rise to a solution and some don't! The maximum I found for H(p) was 3.138, which is different from that for the initial random set (I didn't compare the individual values of all the elements of pp though).

Alan

## Re: Maximize Function: MC 15

I've now compared them. They are:

Alan

## Re: Maximize Function: MC 15

Alan -- thanks for having another look. I have been playing around with it, too, and note the same behaviors that you have -- specifically, that whether or not it converges to a solution is highly dependent on the initial guess values. I note also that there should be valid solutions for values of mu_p across the entire range of P (i.e., from 0.259 to 0.718), but that some of these values are much more difficult than others.

For example, for the case of mu_p=0.259, the only valid solution should be p[i=0 for i=0;26 and p[27=1 -- this is a solution that would most certainly never be found (well, not in a reasonable time) using random guess values. For other states (i.e., values of mu_p), there is not a known closed-form solution that can be used to inform the guess values for the calculation.

So, it seems like maybe the way to go is to do a repetative calculation. Maybe a I write a loop that takes mu_p as an input, performs the calculation 1000 (or whatever) times, and spits out the vector corresponding to the maximum value? Thoughts?

## Re: Maximize Function: MC 15

OK, attached is a modified sheet that calls the Maximize(f,v) function 'n' times. It executes without error, but the results are incorrect. What am I missing? Thanks.

## Re: Maximize Function: MC 15

OK, I'm an idiot. Worksheet (below) now works correctly (I think). Putting it in to production mode to look for remaining issues. Thanks, all.

## Re: Maximize Function: MC 15

Good idea, but why log to the base N? The values of v are essentially the same if you use base 10, though you don't seem to get the same H(v) as in the single run worksheet (suggests perhaps that your hypersurface has a steep spike in it?).

Alan

## Re: Maximize Function: MC 15

Oh, yeah -- sorry about that. By using log_N, I ensure that all of the results are [0,1]. Strictly a matter of convenience, it doesn't change the overall results of the sheet. Thanks again for your help.

Announcements