-1

I would like to solve the following equation, wrt $n(e)$

$$f(n(e))=g(n(e)) + \int_{\alpha}^{e} w(n(x))dx $$

The integral there it confuses me.

Any suggestion on how I can implement this on a the computer (I am mostly Matlab user)

thanks

UPDATE

or simplicity assume the integral is between some values $e_1$ and $e_2$ although in general can also be thought as an indefinite integral. Again for simplicity, assume:

$$f(n)=\frac{1}{1-n} \; \rm{and} \;\; g(n) = \frac{n^2}{1-n^3}$$

I picked those function randomly, just for exposition, if it helps i can post the ones i really have but are rather complicated expressions. In the code, i have those

c= @(n) (1+rtax)*k0+wtax*e*n-(1+grate)*k; 
labor= @(n) n - ((1-eta)*c(n))/eta*wtax*e

where everything is known apart from n.

while the $$ w(n) = (1-\eta) \left[c^\eta (1-n)^{(1-\eta)}\right]^{-\mu} \left[\frac{en}{L} - \frac{a}{k}\right]$$

assume everything is known apart from $n$, and $c$ is defined as in the code.

PS : This is a first order condition from a stochastic maximization, and consider e as a particular value in specific state of the world, so n depends on e, implicitly and cannot be taken out of the integral.

user17880
  • 235
  • 1
  • 6
  • Does this integral have limits? What are the forms of $f$, $g$, and $w$? – Bill Barth Jul 27 '14 at 20:27
  • @BillBarth please check my updated post. – user17880 Jul 27 '14 at 21:17
  • In general these are known as integral equations. Have you looked in the literature concerning them for one that's similar to the form you have here? – Bill Barth Jul 27 '14 at 21:32
  • So, if I got your recommendation right, you suggest to first solve numerically for the integral and then "get a number" from it which will allow me to solve the non-lineal equations? I am not that familiar with numerical methods, but I am aware that exist methods for calculating the integral. I was just wondering whether there is a particular methodology here. – user17880 Jul 27 '14 at 22:17
  • 2
    No. My recommendation is that you explore the literature about "integral equations". There's quite a lot of it of that's relevant to your question. – Bill Barth Jul 28 '14 at 01:47
  • I see. Do you have any reference (book) with code examples where I can look at ? I will much appreciate it. – user17880 Jul 28 '14 at 12:53
  • 1
    I don't understand the equation. If the integral has limits, e.g., $\int_0^1 w(n(e)) de$ then your equation contains functions of $e$ on the left and the first term on the right, plus something that doesn't depend on the variable $e$ any more (the integral). Is this what you want? Or do you mean to say that the integral is the antiderivative of $w(n(e))$? – Wolfgang Bangerth Jul 29 '14 at 14:38
  • @WolfgangBangerth Wouldn't the typical integral equation be: $\int_a^e w(n(x))dx$? I think steering user17880 towards the integral equations literature is the most helpful, though. I think it's a good question, nevertheless. – Bill Barth Jul 30 '14 at 19:52
  • I mi-specified the integral indeed, what @BillBarth wrote is correct. So I updated the equation to be closest to what i really wanted. I have already solved for the particular equation. Thank you all anyway. – user17880 Jul 30 '14 at 23:03
  • Maybe you should post your solution as an answer. – Bill Barth Jul 31 '14 at 00:06
  • @BillBarth If the upper bound is $e$, then you can just differentiate everything with regard to $e$ and you will get a differential equation for $n(e)$. The typical integral equation would have a term of the form $\int_0^1 K(e,x) w(n(x)) dx$. – Wolfgang Bangerth Jul 31 '14 at 09:47

1 Answers1

0

I think the easier way to solve this if the integral have limits is to just use numeric methods. The easiest today with a computer is to just select a 'de' and do a Riemann sum of the value calculated for each e to solve the integral. I would go with a de that is say a 10,000th of the integral interval (e2-e1) and decrease that value until you find the solution has the significant digits you want staying the same. Solving time can be an issue depending on the difficulty of the function and the sensitivity it has to the de interval but it is not easy to predict, so testing it is the best option. At the very least you will learn a lot about the function behavior.

If you are in doubt on how to program this, let me know

Rusty30
  • 19
  • 1