-1
$\begingroup$

Could you help me with what Mathematica is doing here, in the last lines? (The rest is here for context.) I removed the output to let you simply run this. Thanks.

k=10/3
u[c_,l_]:=Log[c]-Log[1+l^(1+k)/(1+k)]
T[z_]:=(1-0.84/1.3) * z
lType[n_]:=ArgMax[{u[n l-T[n l],l],l>=0},l]
zType[n_] := n lType[n]
Type := InverseFunction[zType]
Type[5345]
Type[2]
Type[4324424]

With a much longer version with some context, you can also switch to https://stackoverflow.com/questions/10641713/mathematica-define-inverse-only-where-it-exists

Or please reconsider the same code with some output to see what my problem is with the inverse:

k=10/3
10/3
Utility function as in Saez 2001 allowing for income effects:
u[c_,l_]:=Log[c]-Log[1+l^(1+k)/(1+k)]
Actual tax schedule (approximate)
T[z_]:=(1-0.84/1.3) * z
Equation 14:
lType[n_]:=ArgMax[{u[n l-T[n l],l],l>=0},l]
zType[n_] := n lType[n]
Type := InverseFunction[zType] does not seem to work.
Type := InverseFunction[zType]
Type[5345]
5030.985810589009`
Type[2]
(zType^(-1))[2]
Type[4324424]
(zType^(-1))[4324424]
$\endgroup$
5
  • 1
    $\begingroup$ It might help if you could re-post your code so that it is easily copied and pasted into Mathematica (i.e. without the Ins] and with the Outs separated. A bit more context might help too. $\endgroup$ May 17, 2012 at 19:16
  • $\begingroup$ @ian.milligan: Thanks, I'll try. This is how you can copy from Mathematica, no? Copy as plain text? On context I could guide you to a similar StackOverflow posting, which did not go anywhere partly because of the context. :) And I was embarrassed by the cross-posting, a no-no. $\endgroup$
    – László
    May 17, 2012 at 19:27
  • 3
    $\begingroup$ László, if you do a Merge Cells before the copy you won't have all the In/Out tags. $\endgroup$
    – Mr.Wizard
    May 17, 2012 at 19:42
  • $\begingroup$ @Mr.Wizard: This is great, what a newbie I am! Thanks. I hope all would run just as well this way? $\endgroup$
    – László
    May 17, 2012 at 19:56
  • $\begingroup$ @László Even better: use this to copy code meta.mathematica.stackexchange.com/a/155/745 $\endgroup$
    – Ajasja
    May 21, 2012 at 7:49

1 Answer 1

1
$\begingroup$

Is this the problem:

In

 lType[n_]:=ArgMax[{u[n l-T[n l],l],l>=0},l]

l is not defined.

$\endgroup$

Your Answer

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

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