Skip to content

Commit 0fefd8a

Browse files
committed
bugfix in plotting.
Former-commit-id: a85397b [formerly a85397b [formerly 6559080]] Former-commit-id: 39fd607b2104df7d0baa867d9e0a98f9a25ef37f Former-commit-id: f917994
1 parent 196e572 commit 0fefd8a

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

python/example3-sv.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@
7575
plt.figure(1)
7676

7777
## Plot the log-returns
78-
plt.subplot(5, 3, (1, 2, 3))
78+
plt.subplot(5, 3, (1, 3))
7979
plt.plot(y, color='#1B9E77', linewidth=1.5)
8080
plt.xlabel("time")
8181
plt.ylabel("log-return")
8282

8383

8484
## Plot the log-volatility estimate
85-
plt.subplot(5, 3, (4, 5, 6))
85+
plt.subplot(5, 3, (4, 6))
8686
plt.plot(np.mean(resXhat, axis=0), color='#D95F02', linewidth=1.5)
8787
plt.xlabel("time")
8888
plt.ylabel("log-volatility estimate")
@@ -114,8 +114,8 @@
114114
macf = macf[macf.size/2:]
115115
macf = macf[0:100]
116116
macf /= macf[0]
117-
grid = range(len(macf))
118-
plt.plot(grid, macf, color='#7570B3')
117+
grid_acf = range(len(macf))
118+
plt.plot(grid_acf, macf, color='#7570B3')
119119
plt.xlabel("lag")
120120
plt.ylabel("ACF of mu")
121121

@@ -145,8 +145,8 @@
145145
macf = macf[macf.size/2:]
146146
macf = macf[0:100]
147147
macf /= macf[0]
148-
grid = range(len(macf))
149-
plt.plot(grid, macf, color='#E7298A')
148+
grid_acf = range(len(macf))
149+
plt.plot(grid_acf, macf, color='#E7298A')
150150
plt.xlabel("lag")
151151
plt.ylabel("ACF of phi")
152152

@@ -175,8 +175,8 @@
175175
macf = macf[macf.size/2:]
176176
macf = macf[0:100]
177177
macf /= macf[0]
178-
grid = range(len(macf))
179-
plt.plot(grid, macf, color='#66A61E')
178+
grid_acf = range(len(macf))
179+
plt.plot(grid_acf, macf, color='#66A61E')
180180
plt.xlabel("lag")
181181
plt.ylabel("ACF of sigmav")
182182

0 commit comments

Comments
 (0)