Skip to content

Commit 07b5ad5

Browse files
committed
Merged master.
1 parent 288ccc0 commit 07b5ad5

37 files changed

+2740
-183
lines changed

MANIFEST

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
setup.cfg
33
setup.py
44
quantecon/__init__.py
5+
quantecon/arma.py
56
quantecon/ce_util.py
67
quantecon/compute_fp.py
78
quantecon/discrete_rv.py
@@ -10,14 +11,13 @@ quantecon/ecdf.py
1011
quantecon/estspec.py
1112
quantecon/kalman.py
1213
quantecon/lae.py
13-
quantecon/linproc.py
1414
quantecon/lqcontrol.py
1515
quantecon/lss.py
16+
quantecon/matrix_eqn.py
1617
quantecon/mc_tools.py
1718
quantecon/quad.py
1819
quantecon/quadsums.py
1920
quantecon/rank_nullspace.py
20-
quantecon/riccati.py
2121
quantecon/robustlq.py
2222
quantecon/tauchen.py
2323
quantecon/models/__init__.py
@@ -29,15 +29,17 @@ quantecon/models/lucastree.py
2929
quantecon/models/odu.py
3030
quantecon/models/optgrowth.py
3131
quantecon/tests/__init__.py
32+
quantecon/tests/test_arma.py
3233
quantecon/tests/test_compute_fp.py
3334
quantecon/tests/test_discrete_rv.py
3435
quantecon/tests/test_ecdf.py
3536
quantecon/tests/test_estspec.py
3637
quantecon/tests/test_kalman.py
3738
quantecon/tests/test_lae.py
38-
quantecon/tests/test_linproc.py
3939
quantecon/tests/test_lqcontrol.py
4040
quantecon/tests/test_lss.py
41+
quantecon/tests/test_lyapunov.py
42+
quantecon/tests/test_matrix_eqn.py
4143
quantecon/tests/test_mc_tools.py
4244
quantecon/tests/test_quad.py
4345
quantecon/tests/test_quadsum.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Assuming you have [pip](https://pypi.python.org/pypi/pip) on your computer --- a
3737
at a terminal prompt
3838

3939
#### Current Build and Coverage Status:
40-
[![Build Status](https://travis-ci.org/jstac/quant-econ.svg?branch=tests)](https://travis-ci.org/jstac/quant-econ)
40+
[![Build Status](https://travis-ci.org/jstac/quant-econ.svg?branch=master)](https://travis-ci.org/jstac/quant-econ)
4141
[![Coverage Status](https://coveralls.io/repos/jstac/quant-econ/badge.png)](https://coveralls.io/r/jstac/quant-econ)
4242

4343

examples/duopoly_lqnash.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"""
2+
Filename: lqnash.py
3+
Authors: Chase Coleman, Thomas Sargent
4+
5+
This file provides an example of a Markov Perfect Equilibrium for a
6+
simple duopoly example.
7+
8+
See the lecture at http://quant-econ.net/markov_perfect.html for a
9+
description of the model.
10+
11+
"""
12+
from __future__ import division
13+
import sys
14+
import numpy as np
15+
import scipy.linalg as la
16+
import matplotlib.pyplot as plt
17+
from numpy import sqrt, max, eye, dot, zeros, cumsum, array
18+
from numpy.random import randn
19+
from quantecon.lqnash import nnash
20+
21+
22+
#---------------------------------------------------------------------#
23+
# Set up parameter values and LQ matrices
24+
# Remember state is x_t = [1, y_{1, t}, y_{2, t}] and
25+
# control is u_{i, t} = [y_{i, t+1} - y_{i, t}]
26+
#---------------------------------------------------------------------#
27+
a0 = 10.
28+
a1 = 1.
29+
beta = 1.
30+
d = .5
31+
32+
a = eye(3)
33+
b1 = array([[0.], [1.], [0.]])
34+
b2 = array([[0.], [0.], [1.]])
35+
36+
r1 = array([[a0, 0., 0.],
37+
[0., -a1, -a1/2.],
38+
[0, -a1/2., 0.]])
39+
40+
r2 = array([[a0, 0., 0.],
41+
[0., 0., -a1/2.],
42+
[0, -a1/2., -a1]])
43+
44+
q1 = array([[-.5*d]])
45+
q2 = array([[-.5*d]])
46+
47+
48+
#---------------------------------------------------------------------#
49+
# Solve using QE's nnash function
50+
#---------------------------------------------------------------------#
51+
52+
f1, f2, p1, p2 = nnash(a, b1, b2, r1, r2, q1, q2, 0., 0., 0., 0., 0., 0.,
53+
tol=1e-8, max_iter=1000)

examples/evans_sargent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
import numpy as np
2121
from quantecon import LQ
22-
from scipy.linalg import solve_discrete_lyapunov
22+
from quantecon.matrix_eqn import solve_discrete_lyapunov
2323
from scipy.optimize import root
2424

2525
def computeG(A0, A1, d, Q0, tau0, beta, mu):
2626
"""
2727
Compute government income given mu and return tax revenues and
28-
policy matrixes for the planner.
28+
policy matrixes for the planner.
2929
3030
Parameters
3131
----------

examples/illustrates_lln.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
# == Compute sample mean at each n == #
4444
sample_mean = np.empty(n)
45-
for i in range(1,n):
46-
sample_mean[i] = np.mean(data[:i])
45+
for i in range(n):
46+
sample_mean[i] = np.mean(data[:i+1])
4747

4848
# == Plot == #
4949
ax.plot(list(range(n)), data, 'o', color='grey', alpha=0.5)
@@ -55,6 +55,3 @@
5555
ax.legend(**legend_args)
5656

5757
plt.show()
58-
59-
60-

0 commit comments

Comments
 (0)