<p>Here is an example where <span class="math-container">$x_i$</span>s are necessities and will always be consumed in positive quantities and <span class="math-container">$y$</span> and <span class="math-container">$z$</span> will be consumed in positive quantity only when income of the individual is above a certain threshold.</p>
<p><strong>Problem</strong>. Suppose the utility function is <span class="math-container">$\displaystyle u(x_1,\ldots,x_L, y,z) =\left(\sum_{i=1}^{L}\alpha_i\ln x_i\right)+y^\beta z^{1-\beta}$</span>, where <span class="math-container">$\displaystyle\sum_{i=1}^{L}\alpha_i = 1$</span> and <span class="math-container">$\alpha_i &gt; 0$</span> for all <span class="math-container">$i\in\{1,2,\ldots,L\}$</span>, and <span class="math-container">$\beta\in (0,1)$</span>. What is the solution to this consumer's problem?</p>
<p><span class="math-container">$\displaystyle\max_{x_1,x_2,\ldots,x_L,y,z} \ \left(\sum_{i=1}^{L}\alpha_i\ln x_i\right)+y^\beta z^{1-\beta}$</span>
<span class="math-container">$\displaystyle\text{s.t.} \ \sum_{i=1}^{L}p_ix_i+(p_Yy+p_Zz)\leq M$</span>
<span class="math-container">$\text{and } x_1&gt; 0, \ x_2&gt; 0, \ldots, x_L&gt; 0, y\geq 0, z\geq 0$</span>
where <span class="math-container">$L \in\mathbb{N}$</span>, <span class="math-container">$p_1&gt;0$</span>, <span class="math-container">$p_2&gt;0,\ldots, p_L&gt;0$</span>, <span class="math-container">$p_Y&gt;0$</span>, <span class="math-container">$p_Z&gt;0$</span> and <span class="math-container">$M&gt; 0$</span></p>
<p><strong>Solution</strong>. Solving this problem we get the demand for <span class="math-container">$x_i$</span> as:
<span class="math-container">$\displaystyle x_i^d(p_1,p_2,\ldots,p_L,p_Y,p_Z,M) = \begin{cases} \dfrac{\alpha_iM}{p_i} &amp; \text{if } \displaystyle M\leq \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \dfrac{\alpha_ip_Y^\beta p_Z^{1-\beta}}{p_i\beta^\beta (1-\beta)^{1-\beta}} &amp; \text{if } \displaystyle M&gt; \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$</span>
and demand for <span class="math-container">$y$</span> and <span class="math-container">$z$</span> as:
<span class="math-container">$\displaystyle y^d(p_1,p_2,\ldots,p_L,p_Y,p_Z,M) = \begin{cases} 0 &amp; \text{if } \displaystyle M \leq \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \dfrac{\beta}{p_Y}\left(M - \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}}\right) &amp; \text{if } \displaystyle M &gt; \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$</span>
<span class="math-container">$\displaystyle z^d(p_1,p_2,\ldots,p_L,p_Y,p_Z,M) = \begin{cases} 0 &amp; \text{if } \displaystyle M \leq \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \left(\dfrac{1-\beta}{p_Z}\right)\left(M - \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}}\right) &amp; \text{if } \displaystyle M &gt; \dfrac{p_Y^\beta p_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$</span>
respectively.</p>
<p>More examples are available on this forum: <a href="https://forum.econschool.in/t/examples-of-utility-maximisation-problems-involving-more-than-three-goods/46" rel="nofollow noreferrer">https://forum.econschool.in/t/examples-of-utility-maximisation-problems-involving-more-than-three-goods/46</a></p>

CC BY-SA 4.0
2024-05-30T12:30:40.973Z
2024-05-30T12:30:40.973Z
Amit
<p>I'm trying to build a computer simulation of an economy which separate simulation for each household and I'm trying to figure out what utility function should I use to model the households behavior. I want to model goods as falling into categories (e.g. food category consisting of vegetables and fruits)</p>
<p>My criterias for ideal utility function (in order of importance):</p>
<ol>
<li>Cause total consumption of goods in certain &quot;basic&quot; groups to be non-zero (here Cobb-Douglas is enough: <span class="math-container">$U=ln(food)+ln(cloths)$</span>)</li>
<li>Encourage diversity within group (e.g. <span class="math-container">$U=ln(\sqrt{fruits}+\sqrt{vegetables})+ln(clothes)$</span>)</li>
<li>Allows consumption in certain groups to be zero (e.g. <span class="math-container">$U=ln(\sqrt{fruits}+\sqrt{vegetables})+ln(clothes)+\sqrt{tourism}$</span>)</li>
<li>Has a (readable and convenient) closed form optimization solution for budget constraint <span class="math-container">$\sum{price_i*good_i=budget}$</span></li>
<li>Allows certain goods or categories of goods to be complementary (honestly have no idea how to incorporate this)</li>
</ol>
<p>I understand that no objective answer is possible here, but I'd like to learn if there are some utilities functions that satisfy some of criterias above and/or learn what multi-goods universal utility functions are used in practice (I was taught only two-good task specific utility functions in university).</p>

CC BY-SA 4.0
2021-03-14T12:24:36.143Z
4. Since you are running a computer simulation, why do you need a closed form solution? These are convex functions, seems like you could get a pretty good approximate solution with the gradient method.
Giskard
CC BY-SA 4.0
2021-03-14T12:28:01.050Z
5. The utility representation for perfect complements $x_1,x_2$ is $U(x_1,x_2) = \min(x_1,x_2)$.
Giskard
CC BY-SA 4.0
2021-03-16T07:34:25.977Z
@Giskard there are lots of problems with absence of the closed form solution, such as higher computation complexity, inability to derive indirect utility (to make intertemporal choice) and worse interpretability
kandi
CC BY-SA 4.0
2021-03-16T07:39:59.283Z
Indeed, the computational costs will be higher. Is this prohibitive though ("*small computer simulation*")? I do not understand your point about intertemporal choice; unless your agents see the future you will probably be using some sort of adjustment/learning algorithm there anyway. If they do see the future then it is still convex optimization.
Giskard
CC BY-SA 4.0
2021-03-16T08:12:14.123Z
@Giskard I guess I misused a word "small" there. By it I meant that what I'm doing is not a big project made by a team, but rather just me experimenting. This doesn't mean that there will be small amount of computations. To give a broader context, I consider turning my model into a PC game where all households of a country are simulated if the experiment works out, therefore computation complexity is actually quite an issue for me
kandi
CC BY-SA 4.0
2021-03-16T14:15:02.460Z
I'd recommend looking into the empirical industrial organization literature a bit and see some of the work they've done regarding functional forms for demand estimation. For now, have you looked into nested functional forms? (For example, you might be able to use a couple of different nested CES utility functions: U=a*CES(1)+b*CES(2)... where CES(1) CES(2) etc are different CES functions where each parameterize different types of goods.) Overall though, I think the main key is going to be having different households' parameter values be drawn from a distribution to generate heterogeneity.
AndrewC
CC BY-SA 4.0
2021-03-19T21:15:27.147Z
@AndrewC consider expanding it into an answer. That seems like a good suggestion for this case, no reason why you should not collect the points
1muflon1
CC BY-SA 4.0
2021-03-19T21:27:24.430Z
@1muflon1 I agree, this comment actually helps a lot, and given that there are no answers, I'd be happy to award @ AndrewC with the points
kandi
CC BY-SA 4.0
2021-03-20T00:44:44.317Z
@1muflon1 and kandi--glad it helped! I'll expand it tonight or early tomorrow morning, since I want to actually add more useful leads (especially for a bountied question, it's only fair that you get more than a vague ''try looking at these types of functions, perhaps'' answer!)
AndrewC
CC BY-SA 4.0
2023-04-07T16:27:14.680Z
The $+ \sqrt{tourism}$ term wouldn’t work as at $tourism = 0$ its marginal utility would be $\infty$, so we couldn’t get a $tourism = 0$ optimum. For that purpose the term should be $+ tourism$
Nicolas Torres
<microeconomics><utility><consumer-theory>
Looking for an universal utility function
kandi
# Looking for an universal utility function

(Asked by: username_0 on 2021-03-13)

I'm trying to build a computer simulation of an economy which separate simulation for each household and I'm trying to figure out what utility function should I use to model the households behavior. I want to model goods as falling into categories (e.g. food category consisting of vegetables and fruits)

My criterias for ideal utility function (in order of importance):

1. Cause total consumption of goods in certain "basic" groups to be non-zero (here Cobb-Douglas is enough: $U=ln(food)+ln(cloths)$)
2. Encourage diversity within group (e.g. $U=ln(\sqrt{fruits}+\sqrt{vegetables})+ln(clothes)$)
3. Allows consumption in certain groups to be zero (e.g. $U=ln(\sqrt{fruits}+\sqrt{vegetables})+ln(clothes)+\sqrt{tourism}$)
4. Has a (readable and convenient) closed form optimization solution for budget constraint $\sum{price\_i\*good\_i=budget}$
5. Allows certain goods or categories of goods to be complementary (honestly have no idea how to incorporate this)

I understand that no objective answer is possible here, but I'd like to learn if there are some utilities functions that satisfy some of criterias above and/or learn what multi-goods universal utility functions are used in practice (I was taught only two-good task specific utility functions in university).

**Tags:** microeconomics, utility, consumer-theory
> **Comments:**
> **username_1**: 4. Since you are running a computer simulation, why do you need a closed form solution? These are convex functions, seems like you could get a pretty good approximate solution with the gradient method.  
> **username_1**: 5. The utility representation for perfect complements $x_1,x_2$ is $U(x_1,x_2) = \min(x_1,x_2)$.  
> **username_0**: @Giskard there are lots of problems with absence of the closed form solution, such as higher computation complexity, inability to derive indirect utility (to make intertemporal choice) and worse interpretability  
> **username_1**: Indeed, the computational costs will be higher. Is this prohibitive though ("*small computer simulation*")? I do not understand your point about intertemporal choice; unless your agents see the future you will probably be using some sort of adjustment/learning algorithm there anyway. If they do see the future then it is still convex optimization.  
> **username_0**: @Giskard I guess I misused a word "small" there. By it I meant that what I'm doing is not a big project made by a team, but rather just me experimenting. This doesn't mean that there will be small amount of computations. To give a broader context, I consider turning my model into a PC game where all households of a country are simulated if the experiment works out, therefore computation complexity is actually quite an issue for me  
> **username_2**: I'd recommend looking into the empirical industrial organization literature a bit and see some of the work they've done regarding functional forms for demand estimation. For now, have you looked into nested functional forms? (For example, you might be able to use a couple of different nested CES utility functions: U=a*CES(1)+b*CES(2)... where CES(1) CES(2) etc are different CES functions where each parameterize different types of goods.) Overall though, I think the main key is going to be having different households' parameter values be drawn from a distribution to generate heterogeneity.  
> **username_3**: @AndrewC consider expanding it into an answer. That seems like a good suggestion for this case, no reason why you should not collect the points  
> **username_0**: @1muflon1 I agree, this comment actually helps a lot, and given that there are no answers, I'd be happy to award @ AndrewC with the points  
> **username_2**: @1muflon1 and kandi--glad it helped! I'll expand it tonight or early tomorrow morning, since I want to actually add more useful leads (especially for a bountied question, it's only fair that you get more than a vague ''try looking at these types of functions, perhaps'' answer!)  
> **username_4**: The $+ \sqrt{tourism}$ term wouldn’t work as at $tourism = 0$ its marginal utility would be $\infty$, so we couldn’t get a $tourism = 0$ optimum. For that purpose the term should be $+ tourism$  

---

## 1 answers

### Answer by username_5 on 2024-05-30. Score: 1

Here is an example where $x\_i$s are necessities and will always be consumed in positive quantities and $y$ and $z$ will be consumed in positive quantity only when income of the individual is above a certain threshold.

**Problem**. Suppose the utility function is $\displaystyle u(x\_1,\ldots,x\_L, y,z) =\left(\sum\_{i=1}^{L}\alpha\_i\ln x\_i\right)+y^\beta z^{1-\beta}$, where $\displaystyle\sum\_{i=1}^{L}\alpha\_i = 1$ and $\alpha\_i > 0$ for all $i\in\{1,2,\ldots,L\}$, and $\beta\in (0,1)$. What is the solution to this consumer's problem?

$\displaystyle\max\_{x\_1,x\_2,\ldots,x\_L,y,z} \ \left(\sum\_{i=1}^{L}\alpha\_i\ln x\_i\right)+y^\beta z^{1-\beta}$
$\displaystyle\text{s.t.} \ \sum\_{i=1}^{L}p\_ix\_i+(p\_Yy+p\_Zz)\leq M$
$\text{and } x\_1> 0, \ x\_2> 0, \ldots, x\_L> 0, y\geq 0, z\geq 0$
where $L \in\mathbb{N}$, $p\_1>0$, $p\_2>0,\ldots, p\_L>0$, $p\_Y>0$, $p\_Z>0$ and $M> 0$

**Solution**. Solving this problem we get the demand for $x\_i$ as:
$\displaystyle x\_i^d(p\_1,p\_2,\ldots,p\_L,p\_Y,p\_Z,M) = \begin{cases} \dfrac{\alpha\_iM}{p\_i} & \text{if } \displaystyle M\leq \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \dfrac{\alpha\_ip\_Y^\beta p\_Z^{1-\beta}}{p\_i\beta^\beta (1-\beta)^{1-\beta}} & \text{if } \displaystyle M> \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$
and demand for $y$ and $z$ as:
$\displaystyle y^d(p\_1,p\_2,\ldots,p\_L,p\_Y,p\_Z,M) = \begin{cases} 0 & \text{if } \displaystyle M \leq \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \dfrac{\beta}{p\_Y}\left(M - \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}}\right) & \text{if } \displaystyle M > \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$
$\displaystyle z^d(p\_1,p\_2,\ldots,p\_L,p\_Y,p\_Z,M) = \begin{cases} 0 & \text{if } \displaystyle M \leq \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \\ \left(\dfrac{1-\beta}{p\_Z}\right)\left(M - \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}}\right) & \text{if } \displaystyle M > \dfrac{p\_Y^\beta p\_Z^{1-\beta}}{\beta^\beta (1-\beta)^{1-\beta}} \end{cases}$
respectively.

More examples are available on this forum: <https://forum.econschool.in/t/examples-of-utility-maximisation-problems-involving-more-than-three-goods/46>


---

