I need to solve two constrained optimization problems where the second problem depends on the results of the first.

The agents in my economy maximize utility: $$\max_{c,d,l} p\ln(c)+\ln(d)+\ln(l)$$ subject to a budget constraint: $$(1-t)w(1-l)+T \ge c+(1+\tau)d$$ where choose $c-$ denotes consumption of non-durable goods, $d$-consumption of durable goods, and $l$- denotes labor supply.

There are two agents in the economy, high skilled and low skilled (denoted by $X_h$ and $X_l$, respectively), so solving for each of them will yield the demand functions: $$c_l (t,\tau,T), c_h (t,\tau,T), d_l(t,\tau,T), d_h (t,\tau,T)$$ and the supply functions: $$l_l (t,\tau,T), l_h (t,\tau,T)$$

This part I can calculate myself but the next part is where I'm struggling. Given these demand and supply functions, the government needs to choose the tax parameters ($t,T,\tau$) that maximize the overall welfare: $\max_{t,\tau,T} p\ln(c_l)+p\ln(c_h)+2(1-p)\ln(\frac{c_l +c_h }{2})+\ln(d_l)+\ln(d_h)+\ln(l_l)+\ln(l_h)$ subject to the resource constraint: $t(w_h(1-l_h)+w_l(1-l_l))+\tau (d_l+d_h) \ge 2T$ Where $t$ is the income tax, $T$ is the lump sum tax and $tau$- denotes the tax on durable consumption. So my first problem is this: how do I solve each agent's constrained optimization problem to find their demand and labor supply functions? And once I've found those, how can I use them to solve the governments optimal tax policy? I've tried manually defining the demand and labor supply functions, and then deriving the social welfare function manually and using solve to find the result: enter image description here

But I'm getting a weird result (see image)

enter image description here I don't understand what <<1>> means or <<32>>...

Once I will have all of this figured out, the final part will be to check the sensitivity of the overall welfare function: $p\ln(c_l)+p\ln(c_h)+\ln(d_l)+\ln(d_h)+\ln(l_l)+\ln(l_h)$ to $p$. I want to see if the overall welfare is maximal when $p=1$ and if it is strictly increasing in $p$. How can I do that?

  • 3
    $\begingroup$ Please provide your code with a clear indication as to the Mathematica coding related issue you have. $\endgroup$ – Feyre Jan 9 '17 at 12:01
  • $\begingroup$ Also describe your variables and analysis. $\endgroup$ – Nicholas G Jan 9 '17 at 13:07
  • $\begingroup$ I've tries to be more specific as you requested, does this help explain my problem? $\endgroup$ – Nofar Duani Jan 9 '17 at 15:38
  • 1
    $\begingroup$ just to address the specific question the <<>> are indicating large output that has been omitted so the essential form of the result can be displayed compactly. Hit "Show Full Ouput" to see the whole thing. (Beware if its really big its liable to overwhelm your computer) You should include actual code, not images by the way. $\endgroup$ – george2079 Jan 9 '17 at 15:59
  • $\begingroup$ as a suggestion, it is often useful to work through a problem with specific numeric example values assigned to your parameters wherever possible. $\endgroup$ – george2079 Jan 9 '17 at 16:09

This is the easiest way to solve the individual problem

obj := p Log[c] + Log[d] + Log[l]
constraint := (1 - t) w (1 - l) + T - c - (1 + τ) d
log = obj - λ constraint
grad = Grad[log, {c, d, l, λ}]
sol = Solve[{grad[[1]] == 0, grad[[2]] == 0, grad[[3]] == 0, 
   grad[[4]] == 0}, {c, d, l, λ}]

which gives

{{c -> (p T + p w - p t w)/(2 + p), 
  d -> (T + w - t w)/((2 + p) (1 + τ)), 
  l -> (-T - w + t w)/((2 + p) (-1 + t) w), λ -> (-2 - p)/(
   T + w - t w)}}

Now your two agents are identical so the collective problem can be simplified to

colobj := 2 p Log[c] + 2 (1 - p) Log[c] + 2 Log[d] + 2 Log[l]
colconstraint := t w (1 - l) + τ d - T
colobj1 = colobj /. sol
colconstraint1 = colconstraint /. sol
log1 = colobj1 - μ colconstraint1
grad1 = FullSimplify[Grad[log1, {t, τ, T,μ}]]
sol = Solve[{grad1[[1, 1]] == 0, grad1[[1, 2]] == 0, 
   grad1[[1, 3]] == 0,grad1[[1, 3]] == 0}, {t, τ, T}]

Which in its turn gives

{{t -> (-1 + p)/p, τ -> (1 - p)/p, 
 T -> ((-1 + p) w)/(3 p), μ -> -(6/w)}}

Hope this will answer your question.


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