GitHub

File tree

  • .github

  • lectures

    • _static/lecture_specific/amss2

Original file line numberDiff line numberDiff line change

@@ -11,3 +11,16 @@ updates:

1111

prefix: ⬆️

1212

schedule:

1313

interval: weekly

14+
15+

- package-ecosystem: "conda"

16+

directory: "/"

17+

commit-message:

18+

prefix: ⬆️

19+

schedule:

20+

interval: weekly

21+

ignore:

22+

- dependency-name: "jupyter-book"

23+

versions: [">=2.0"]

24+

- dependency-name: "python"

25+

# Python version should be constrained by the anaconda distribution version

26+

versions: [">0"]

Original file line numberDiff line numberDiff line change

@@ -3,17 +3,18 @@ channels:

33

- default

44

dependencies:

55

- python=3.13

6-

- anaconda=2025.06

6+

- anaconda=2025.12

77

- pip

88

- pip:

9-

- jupyter-book==1.0.4post1

10-

- quantecon-book-theme==0.9.3

9+

- jupyter-book>=1.0.4post1,<2.0

10+

- quantecon-book-theme==0.15.1

1111

- sphinx-tojupyter==0.3.1

1212

- sphinxext-rediraffe==0.2.7

1313

- sphinx-exercise==1.0.1

1414

- sphinx-proof==0.2.1

1515

- sphinxcontrib-youtube==1.4.1

1616

- sphinx-togglebutton==0.3.2

1717

- sphinx-reredirects==0.1.4

18+

- kaleido

1819
1920
Original file line numberDiff line numberDiff line change

@@ -1194,7 +1194,7 @@ fig.update_layout(width=500,

11941194

fig.update_layout(scene_camera=dict(eye=dict(x=2, y=-2, z=1.5)))

11951195
11961196

# Export to PNG file

1197-

Image(fig.to_image(format="png"))

1197+

Image(fig.to_image(format="png", engine="kaleido"))

11981198

# fig.show() will provide interactive plot when running

11991199

# notebook locally

12001200

```

Original file line numberDiff line numberDiff line change

@@ -1270,7 +1270,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2)))

12701270

fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')

12711271
12721272

# Export to PNG file

1273-

Image(fig.to_image(format="png"))

1273+

Image(fig.to_image(format="png", engine="kaleido"))

12741274

# fig.show() will provide interactive plot when running

12751275

# code locally

12761276

```

@@ -1634,7 +1634,7 @@ fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')

16341634
16351635
16361636

# Export to PNG file

1637-

Image(fig.to_image(format="png"))

1637+

Image(fig.to_image(format="png", engine="kaleido"))

16381638

# fig.show() will provide interactive plot when running

16391639

# code locally

16401640

```

@@ -1685,7 +1685,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2)))

16851685

fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')

16861686
16871687

# Export to PNG file

1688-

Image(fig.to_image(format="png"))

1688+

Image(fig.to_image(format="png", engine="kaleido"))

16891689

# fig.show() will provide interactive plot when running

16901690

# code locally

16911691

```

@@ -1746,7 +1746,7 @@ fig.update_layout(title='Equilibrium equity valuation for the grid of (k,b)')

17461746
17471747
17481748

# Export to PNG file

1749-

Image(fig.to_image(format="png"))

1749+

Image(fig.to_image(format="png", engine="kaleido"))

17501750

# fig.show() will provide interactive plot when running

17511751

# code locally

17521752

```

@@ -1776,7 +1776,7 @@ fig.update_layout(title='Equilibrium bond valuation for the grid of (k,b)')

17761776
17771777
17781778

# Export to PNG file

1779-

Image(fig.to_image(format="png"))

1779+

Image(fig.to_image(format="png", engine="kaleido"))

17801780

# fig.show() will provide interactive plot when running

17811781

# code locally

17821782

```

Original file line numberDiff line numberDiff line change

@@ -39,6 +39,7 @@ sphinx:

3939

'https://doi.org/10.1086/262078',

4040

'https://keras.io/',

4141

'https://data.oecd.org/']

42+

nb_merge_streams: true

4243

nb_mime_priority_overrides: [

4344

# HTML

4445

['html', 'application/vnd.jupyter.widget-view+json', 10],

@@ -85,6 +86,7 @@ sphinx:

8586

header_organisation: QuantEcon

8687

repository_url: https://github.com/QuantEcon/lecture-python-advanced.myst

8788

nb_repository_url: https://github.com/QuantEcon/lecture-python-advanced.notebooks

89+

path_to_docs: lectures

8890

twitter: quantecon

8991

twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png

9092

og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png

Original file line numberDiff line numberDiff line change

@@ -231,15 +231,15 @@ def objf_prime(x):

231231
232232

epsilon = 1e-7

233233

x0 = np.asarray(x, dtype=float)

234-

f0 = np.atleast_1d(objf(x0))

235-

jac = np.zeros([len(x0), len(f0)])

234+

f0 = objf(x0)

235+

grad = np.zeros(len(x0))

236236

dx = np.zeros(len(x0))

237237

for i in range(len(x0)):

238238

dx[i] = epsilon

239-

jac[i] = (objf(x0+dx) - f0)/epsilon

239+

grad[i] = (objf(x0+dx) - f0)/epsilon

240240

dx[i] = 0.0

241241
242-

return jac.transpose()

242+

return grad

243243
244244

def cons(z):

245245

c, n, xprime, T = z[:S], z[S:2 * S], z[2 * S:3 * S], z[3 * S:]

Original file line numberDiff line numberDiff line change

@@ -1020,7 +1020,7 @@ fig.update_layout(title=r'Impulse Response Function',

10201020

yaxis_title=r'$k^{i}_{t}$')

10211021

fig1 = fig

10221022

# Export to PNG file

1023-

Image(fig1.to_image(format="png"))

1023+

Image(fig1.to_image(format="png", engine="kaleido"))

10241024

# fig1.show() will provide interactive plot when running

10251025

# notebook locally

10261026

```

Read the original on github.com ↗