Message Boards Message Boards

Find a maximum of the following function using Grid Search?

Posted 6 years ago

enter image description here

I would like to find the maximum value and the optimal ma and md from the above two functions using GRID search. I have tried but it doesn't work. Do you have any ideas? Any different example of the function with the code would also be great.

f = Integrate[PDF[NormalDistribution[10*Subscript[m, d], 1*Subscript[m, d]], Subscript[c,i]] * (Subscript[m, d]*Subscript[c, i] - 10) * (1-CDF[NormalDistribution[10*Subscript[m, a], 2*Subscript[m, a]], Subscript[c, i]]), {Subscript[c, i], -Infinity, Infinity}]; 
g = Integrate[PDF[NormalDistribution[10*Subscript[m, a], 2*Subscript[m, a]], Subscript[c,i]] * (Subscript[m, a]*Subscript[c, i] - 10) * (1-CDF[NormalDistribution[10*Subscript[m, d], 1*Subscript[m, a]], Subscript[c, i]]), {Subscript[c, i], -Infinity, Infinity}];

NMaximize[f, {Subscript[m, d], Subscript[m, a]},Method -> {"RandomSearch"}];
NMaximize[g, {Subscript[m, d], Subscript[m, a]},Method -> {"RandomSearch"}];

The results show just f and g. It doesn't work for NMaximize. The screenshot is as follows:

enter image description here

POSTED BY: Sanghoon Cho
3 Replies

Have you tested to see if the integrals work for numerical values of md and ma ?

POSTED BY: Frank Kampas

It's not clear what you're trying to do, since you've got NSolve around something that doesn't look like an equation. Maybe you want NIntegrate instead NSolve around Integrate.

POSTED BY: Frank Kampas
Posted 6 years ago

Thank you Frank, I just edited the equations to make it clear. Do you have any ideas?

POSTED BY: Sanghoon Cho
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract