GitHub

Original file line numberDiff line numberDiff line change

@@ -978,16 +978,7 @@ init = np.repeat(1.0, 3)

978978
979979

The result is very close to the ground truth but still slightly different.

980980
981-
982-

We can increase the precision of the floating point numbers and restrict the tolerance to obtain a more accurate approximation (see detailed discussion in the [lecture on JAX](https://jax.quantecon.org/jax_intro.html))

983-
984981

```{code-cell} python3

985-

from jax.config import config

986-
987-

config.update("jax_enable_x64", True)

988-
989-

init = init.astype('float64')

990-
991982

%time k = newton(lambda k: multivariate_solow(k, A=A, s=s, α=α, δ=δ) - k, \

992983

init,\

993984

tol=1e-7)

Read the original on github.com ↗