4

Note 1.: It is rude to edit a question after it was answered; I had to make significant edits to make my answer consistent. Note 2.: this is not a system of equations. There are two functions defined, but only one equation: $$P_D(q) - P_S(q) = 0$$ What helps here is that inverse demand is decreasing in quantity while inverse supply is increasing. So given ...


3

You can also find Kenneth Judd's book on numerical analysis here. It is one of the very known and notorious books in that field.


2

This builds on @Giskard's answer above. Once you know the range of feasible market-clearing quantities, $q \in [ 0, \bar q ]$, you can directly apply R's uniroot function (R manual), which searches a given interval for the zeros of a function. # What are my demand and supply functions? 1 - q and q, because economics. P_D <- function ( q ) { 1 - q } P_S &...


2

Read the theory and then try coding. But you're lucky, because I was eager to develope and implement the forward shooting algorithm myself and thus provide it. Optimal Growth (See Ben Moll for details.) Optimal growth model in continuous time reads \begin{align} &\max_c\int^\infty_0 e^{-\rho t}u(c)dt\\ \text{s.t.}~~~& \dot k = f(k) - \delta k - c\\...


1

More of a comment: There should be an expectation operator in the statement of the problem, otherwise problem doesn't make sense. That "...the deterministic and stochastic value function must be the same..." is not quite right. The value of $\sigma^2$ is crucial in the restriction \begin{align} \rho = \left(-n + \sigma^2\left(1 - \frac{\alpha\gamma}{2}\...


1

Recursive Macroeconomic Theory isn't a "numerical analysis" book per se, but it has an excellent exposition of the shooting algorithm in a growth model in Chapter 11 of the second edition (I don't think the chapter numbers changed much, but chapter is called "Fiscal Policies in the Nonstochastic Growth Model"). I would recommend starting there. References ...


Only top voted, non community-wiki answers of a minimum length are eligible