0
$\begingroup$

I am facing a maximisation problem, and I need to check the concavity of my objective function. (Actually, quasi-concavity would be sufficient, but I have no idea how to check it). In poor words, I have to maximise f(x) wrt x. This is what I have so far:

function = (k*f)*f + 3 f + (1 - f) k (1 + f) t
first = D[function, f]
second = Simplify[ D[first, f]]

Thus, the second order condition is -2 k (-1 + t), where k and t are parameters which can vary in the range [0,1]. I want to determine under which conditions on the parameters the objective function is concave (or quasi-concave). How can I do it?

$\endgroup$

2 Answers 2

2
$\begingroup$
function = (k*f)*f + 3 f + (1 - f) k (1 + f) t //
   Simplify;

To find the function's maximum use Maximize

Maximize[function, f]

enter image description here

For the function to be bounded requires that (t > 1 && k > 0) || (t < 1 && k < 0)

{max, arg} = Assuming[(t > 1 && k > 0) || (t < 1 && k < 0),
  Maximize[function, f] // Simplify]

(* {9/(4 k (-1 + t)) + k t, {f -> 3/(2 k (-1 + t))}} *)

max == function /. arg // Simplify

(* True *)

EDIT Graphically,

Manipulate[
 Module[{
   cond = (tt > 1 && kk > 0) || (tt < 1 && kk < 0),
   maxPt = If[tt == 1 || kk == 0, {},
     {3/(2*kk*(-1 + tt)), 9/(4*kk*(-1 + tt)) + kk*tt}]},
  Plot[function /. {k -> kk, t -> tt}, {f, -5, 5},
   PlotStyle -> If[cond,
     Blue, Directive[Red, Dashed]],
   Epilog -> {If[cond,
      {Text[Style["max", Red, Bold], maxPt, {0, 2}],
       Red, AbsolutePointSize[4], Point[maxPt]},
      Nothing]}]],
 {{kk, -2, k}, -3, 5, .1, Appearance -> "Labeled"},
 {{tt, 0, t}, -5, 5, .1, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank for the answer. So, following your code, a maximum is attained when (t > 1 && k > 0) || (t < 1 && k < 0), right? Does it imply that my function is concave only if those conditions are true? $\endgroup$ Apr 27, 2020 at 20:39
  • $\begingroup$ Play with Manipulate. $\endgroup$
    – Bob Hanlon
    Apr 27, 2020 at 21:29
  • $\begingroup$ Sorry, I tried to understand your code, but I did not get it. The fact is that the function I ma working with is different from the one I posted (that is just an example), so now I cannot understand the code relative to the plot. $\endgroup$ Apr 28, 2020 at 14:30
  • $\begingroup$ Maximize calculates max value of function and value of f at which the max is obtained, each as function of k and t. These values are used to draw & label max on plot of function for selected values of k and t. The control variables kk and tt correspond to k and t. k and t cannot be used directly in the Manipulate since scoping localizes the control variables and they would not be the same as the global variables. Alternatively, define function with explicit arguments: function[k_, t_, f_] = ... so that the control variables can be passed to function. $\endgroup$
    – Bob Hanlon
    Apr 28, 2020 at 14:57
2
$\begingroup$

want to determine under which conditions on the parameters the objective function is concave (or quasi-concave)

If I understand you right, you could try

function = (k*f)*f + 3 f + (1 - f) k (1 + f) t;
grad = D[function, {f, 2}];
Reduce[grad < 0, {k, t}, Reals]

Mathematica graphics

$\endgroup$
4
  • $\begingroup$ @BobHanlon I just read that OP wanted to check concavity. I thought they meant concave up (convex). overlooked later they said down. So you are right, it needs to be <0 instead. Will fix now. Thanks. $\endgroup$
    – Nasser
    Apr 27, 2020 at 20:35
  • $\begingroup$ Thank you for the answer, so my function in concave only if (t > 1 && k > 0) || (t < 1 && k < 0). $\endgroup$ Apr 27, 2020 at 20:41
  • $\begingroup$ @PlasticMan hi. When you say concave do you mean down or up? concave down means it is max. concave up mean is it min. second derivative is positive means it is min. second derivative is negative means it is max. So conditions for max is as shown above, yes. second derivative is 2 k (1 - t). For this to be negative, we see the answer is correct as given by Mathematica. so if your t,k meet any ONE of these two conditions, then it is max. $\endgroup$
    – Nasser
    Apr 27, 2020 at 20:47
  • $\begingroup$ Sorry, I usually use concave and convex, so by concave I mean concave down (I am looking for a maximum). Sorry for the misunderstanding. Thank you for your answer :) $\endgroup$ Apr 28, 2020 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.