Optimization with 2 variables in the objective function and 3 variables in constraint

Carlos2007

New member
Joined
Mar 27, 2018
Messages
6
Dear professors,


I am working with a constrained optimization set up. I have read several books and pdfs online but I haven't found an answer to my problem. All this problem that I will describe now is hypothetical because what I want is to know how to solve the problem. Let's start. In economics, we have utility functions which depend on consumption. Let's consider C1 first period consumption and C2 second period consumption and an utility function U=ln(C1) + Bln(C2) where B is a constant. And the (budget) constraints equal to Y(I)= L(1+r) + C2 and L = I + C1 where Y is total income in the second period, L is a loan that the consumer request in the first period (and (s)he decides between investing and consume in the first period) and I represents the investment in the first period. Note that what the agent wants is to maximize utility and utility is derived just from consumption. However (and of course), in part the more you invest, the larger the second period income and therefore the larger could be the second period (and maybe the total) consumption.


All the examples and textbooks that I have seen they maximize a function lets say F(x,y), subject to g(x,y)=K where K is a constant and of course the optimization can be with inequality or g(x)=K and h(x,y)= M where M is another constant or other kind of constraints. What really matters here is that they maximize F(x,y) subject to constraints where just x and y are the only variables (subject to optimization).


However, in the case of the problem that I presented, we have just two variables in the function that I want to maximize (C1, C2) and three variables are involved in the constraints (C1, C2, and I).


How should be solved this kind of problem?


max U=ln(C1) + Bln(C2)


s.t: Y(I)= L(1+r) + C2


L = I + C1


Where should be obtained the optimal C1, C2 and I


For me the most important thing is you to provide the way of solution but also a book or paper where I can read about this


I am extremely grateful in advance


Thanks in advance
 
Dear professors,


I am working with a constrained optimization set up. I have read several books and pdfs online but I haven't found an answer to my problem. All this problem that I will describe now is hypothetical because what I want is to know how to solve the problem. Let's start. In economics, we have utility functions which depend on consumption. Let's consider C1 first period consumption and C2 second period consumption and an utility function U=ln(C1) + Bln(C2) where B is a constant. And the (budget) constraints equal to Y(I)= L(1+r) + C2 and L = I + C1 where Y is total income in the second period, L is a loan that the consumer request in the first period (and (s)he decides between investing and consume in the first period) and I represents the investment in the first period. Note that what the agent wants is to maximize utility and utility is derived just from consumption. However (and of course), in part the more you invest, the larger the second period income and therefore the larger could be the second period (and maybe the total) consumption.


All the examples and textbooks that I have seen they maximize a function lets say F(x,y), subject to g(x,y)=K where K is a constant and of course the optimization can be with inequality or g(x)=K and h(x,y)= M where M is another constant or other kind of constraints. What really matters here is that they maximize F(x,y) subject to constraints where just x and y are the only variables (subject to optimization).


However, in the case of the problem that I presented, we have just two variables in the function that I want to maximize (C1, C2) and three variables are involved in the constraints (C1, C2, and I).


How should be solved this kind of problem?


max U=ln(C1) + Bln(C2)


s.t: Y(I)= L(1+r) + C2


L = I + C1


Where should be obtained the optimal C1, C2 and I


For me the most important thing is you to provide the way of solution but also a book or paper where I can read about this


I am extremely grateful in advance


Thanks in advance

Not making a ton of sense.

Why is "Consumption" part of income?

What does "Y(I)" mean? Is that multiplication or function notation?

If "I" is unconstrained, whats to stop you from investing a VERY LARGE amount, making your Utility arbitrarily large?
 
Dear professors,


I am working with a constrained optimization set up. I have read several books and pdfs online but I haven't found an answer to my problem. All this problem that I will describe now is hypothetical because what I want is to know how to solve the problem. Let's start. In economics, we have utility functions which depend on consumption. Let's consider C1 first period consumption and C2 second period consumption and an utility function U=ln(C1) + Bln(C2) where B is a constant. And the (budget) constraints equal to Y(I)= L(1+r) + C2 and L = I + C1 where Y is total income in the second period, L is a loan that the consumer request in the first period (and (s)he decides between investing and consume in the first period) and I represents the investment in the first period. Note that what the agent wants is to maximize utility and utility is derived just from consumption. However (and of course), in part the more you invest, the larger the second period income and therefore the larger could be the second period (and maybe the total) consumption.


All the examples and textbooks that I have seen they maximize a function lets say F(x,y), subject to g(x,y)=K where K is a constant and of course the optimization can be with inequality or g(x)=K and h(x,y)= M where M is another constant or other kind of constraints. What really matters here is that they maximize F(x,y) subject to constraints where just x and y are the only variables (subject to optimization).


However, in the case of the problem that I presented, we have just two variables in the function that I want to maximize (C1, C2) and three variables are involved in the constraints (C1, C2, and I).


How should be solved this kind of problem?


max U=ln(C1) + Bln(C2)


s.t: Y(I)= L(1+r) + C2


L = I + C1


Where should be obtained the optimal C1, C2 and I


For me the most important thing is you to provide the way of solution but also a book or paper where I can read about this


I am extremely grateful in advance


Thanks in advance
You must define relationships among all the variables.

Your notation is a bit clumsy, and I suspect that the problem is not set up correctly. As far as I can see, you have set this up so that the consumer has no income whatsoever, and there is no relationship between amounts borrowed or invested and income. So let's proceed as follows

\(\displaystyle a = \text { consumption in first period.}\)

\(\displaystyle b = \text { consumption in second period.}\)

\(\displaystyle c = \text { income in first period, where } c \text { is a positive real constant.}\)

\(\displaystyle d = \text { income in second period, where } d \text { is a positive real constant.}\)

\(\displaystyle e = \text { borrowing in first period.}\)

\(\displaystyle f = \text { investment in first period.}\)

\(\displaystyle r = \text { market interest rate,} \text { where } r \text { is a positive real constant.}\)

\(\displaystyle u = \text {utility for both periods}.\)

Now for constraints.

\(\displaystyle a + b + (f - e)(r) = c + d.\)

\(\displaystyle 0 \le e \le (d - b)(1 + r) .\)

\(\displaystyle 0 \le f \le (c - a).\)

\(\displaystyle ef = 0.\)

The utility function is:

\(\displaystyle u = ln(a) + vln(b),\ \text { where } v \text { is a real constant.}\)

\(\displaystyle \text {Let } w =\)

\(\displaystyle u - \alpha(a + b + fr - er - c - d) - \beta e - \gamma \{e - (d - b(1 + r)\} - \delta f - \epsilon \{ f - (c - a)\} + \zeta ef =\)

\(\displaystyle ln(a) + v ln(b)\)

\(\displaystyle -\ \alpha (a + b + fr - er - c - d) - \beta e - \gamma (e - d + b + br) - \delta f - \epsilon (f - c + a) - \zeta ef.\)

Now we can take a little short cut.

\(\displaystyle \dfrac{\delta w}{\delta \zeta} = 0 \implies ef = 0 \implies e = 0,\ f = 0,\ \text { or } e = 0 = f.\)

\(\displaystyle \text {Case I: } e = 0 = f.\)

\(\displaystyle w = ln(a) + vln(b) - \alpha (a + b - c - d) - \gamma (b + br - d) - \epsilon (a - c).\)

\(\displaystyle \dfrac{\delta w}{\delta a} = 0 \implies 0 = \dfrac{1}{a} - \alpha - \epsilon.\)

\(\displaystyle \dfrac{\delta w}{\delta b} = 0 \implies 0 = \dfrac{v}{b} - \alpha - \epsilon.\)

\(\displaystyle \dfrac{\delta w}{\delta \alpha} = 0 \implies a + b = c + d.\)

\(\displaystyle \dfrac{\delta w}{\delta \gamma} = 0 \implies d = b + br \implies b = \dfrac{d}{1 + r}.\)

\(\displaystyle \dfrac{\delta w}{\delta \epsilon} = 0 \implies a = c.\)

Now if we subtract the first two partials we get

\(\displaystyle \dfrac{1}{a} - \dfrac{v}{b} = 0 \implies av = b.\)

The third partial is the budget constraint.

Now c, d, r, and v are constants so we can find a = c and b = cv from av = b and the fourth partial. But what is interesting is using the fifth partial to get

\(\displaystyle b = \dfrac{d}{1 + r} \implies cv = \dfrac{d}{1 + r} \implies v(1 + r) = \dfrac{d}{c}.\)

What this means is that there will be neither borrowing nor lending only if there is a specific relationship between the individual's time preference, v, the market rate of interest, r, and the ratio of the individual's income in the two periods, d/c. That makes economic sense. in particular, if c = d, meaning constant income in both periods, there will be no borrowing and no investment only if

\(\displaystyle r = \dfrac{1 - v}{v}.\)

Now there are still two cases to go. I shall let you explore them.
 
Last edited:
Not making a ton of sense.

Why is "Consumption" part of income?

What does "Y(I)" mean? Is that multiplication or function notation?

If "I" is unconstrained, whats to stop you from investing a VERY LARGE amount, making your Utility arbitrarily large?

Dear professor, very much thank you for your reply. Y(I) is total second period income and it depends on investment (I). Maybe I did not mentioned, but the first period consumption and investment is constrained by the loan and the loan size is determined by the bank, not by the borrower. Let's say an individual in the first period of his life only can borrow a certain amount of money from the bank and he need to decide between investment (to enjoy larger income in the second period) and first period consumption. In the second period it earn that income, repay the loan of the first period and consume the second period consumption.

Of course, under this hypothetical case, one can think that the best option is to invest the whole loan in the first period and after just consume in the second period (as you suggested) but in other cases this may not be the case. Note that the purpose of my question is not to solve an specific problem. The real purpose is to learn how to solve this kind of problems of n variables in the objective function and n+1 variables involved in the constraints.
 
You must define relationships among all the variables.

Your notation is a bit clumsy, and I suspect that the problem is not set up correctly. As far as I can see, you have set this up so that the consumer has no income whatsoever, and there is no relationship between amounts borrowed or invested and income

Dear professor JeffM, Very much thank you for your reply and your explanation have been useful for me. Maybe my notation may be clumsy. However I don't think there is something rare in the problem that I am describing. Maybe I didn't explain myself 100% clearly but consider this. What I meant is that in the first period of their lives the individuals only can get loans (they don't "earn" income). With the loans they need to decide between first period consumption and investment. The amount invested will warrant them a second period income of Y which the individual should use to repay the loan of the first period and consume in the second period. That is it. What is the problem with this set up?
 
Dear professor JeffM, Very much thank you for your reply and your explanation have been useful for me. Maybe my notation may be clumsy. However I don't think there is something rare in the problem that I am describing. Maybe I didn't explain myself 100% clearly but consider this. What I meant is that in the first period of their lives the individuals only can get loans (they don't "earn" income). With the loans they need to decide between first period consumption and investment. The amount invested will warrant them a second period income of Y which the individual should use to repay the loan of the first period and consume in the second period. That is it. What is the problem with this set up?
Well there is nothing wrong with your set of assumptions in terms of theoretical economics. Theoretical economics permits you to make any assumptions that you want: it is a free exercise of the human imagination.

Of course, your assumptions are highly contra-factual so it is doubtful that the resulting theory has any practical relevance: try getting a loan when you have no income and your only asset is an investment with an initial market value less than the amount of the loan that is secured by the investment. Furthermore, if loan and investment have the same rate of return, no benefit arises from the arbitrage. Nevertheless, there are reputable economists who have asserted that the less realistic the assumptions, the better the theory.

Moreover, as indicated by tkhunny's comments, it was far from clear what your assumptions were. You must define all terms, identify clearly what are variables and what are presumed constants, and specify completely every relation being assumed.

In any case, even if the four independent variables are consumption in the first and second periods and the amounts borrowed and invested in the first period and the dependent variable depends only on the first two variables, you can still use the method of Lagrangian multipliers if the constraints involve all four variables. You set up the Lagrangian using the function describing the dependent variable minus, for each constraint, a Lagrangian multiplier times the implicit function describing that constraint. Then you set all the partials to zero, and solve the resulting system of simultaneous equations. It is time consuming, but quite mechanical.

EDIT: You seem to have a number of misconceptions. In this specific case, it is only technically true that the objective function has only two independent variables. Those variables are themselves dependent on other variables.
 
Last edited:
To supplement my previous answer, if n independent variables are involved in the model and only k < n of those variables determine the objective function, then you will need a Lagrangian multiplier for each relevant constraint.
 
To supplement my previous answer, if n independent variables are involved in the model and only k < n of those variables determine the objective function, then you will need a Lagrangian multiplier for each relevant constraint.

Dear professor Jeff, this is exactly the answer that I was looking for. My real doubt/question or whatever was about if it is possible to solve a problem with k variables in the objective function having n > k variables in the constraints. Because all the books and pdf (that I have read) only focus on problems or cases where there are n variables in the objective function and n variables in the constraints (of course, after all the possible rearrangements of constraints equations).
 
Dear professor Jeff, this is exactly the answer that I was looking for. My real doubt/question or whatever was about if it is possible to solve a problem with k variables in the objective function having n > k variables in the constraints. Because all the books and pdf (that I have read) only focus on problems or cases where there are n variables in the objective function and n variables in the constraints (of course, after all the possible rearrangements of constraints equations).
Glad to have helped. As you will see by rereading my first post, I gave you an example with four independent variables in the model, but only two in the objective function.
 
Glad to have helped. As you will see by rereading my first post, I gave you an example with four independent variables in the model, but only two in the objective function.

Yes, very much thank you for your help and time. For sure that example and the rest of your comments were great (same hold for the other professor, of course).
 
Top