CompEcon Toolbox:
DemQua01
Equidistributed sequences on unit square in $R^2$
Randall Romero Aguilar, PhD

This demo is based on the original Matlab demo accompanying the Computational Economics and Finance 2001 textbook by Mario Miranda and Paul Fackler.

Last updated: 2020-Sep-10

Initial tasks

In [ ]:
if 'google.colab' in str(get_ipython()):
    print("This notebook is running on Google Colab. Installing the compecon package.")
    !pip install compecon
In [ ]:
from compecon import qnwequi, demo
import matplotlib.pyplot as plt
In [ ]:
methods = [['N', 'Neiderreiter Sequence'],
           ['W', 'Weyl Sequence'],
           ['R','Pseudo-Random Sequence']]
In [ ]:
def equiplot(method):
    x, w = qnwequi(2500, [0, 0], [1, 1], method[0])
    fig = demo.figure(method[1], '$x_1$', '$x_2$',[0, 1], [0, 1], figsize=[5,5])
    plt.plot(*x,'.')
    plt.xticks([0, 1])
    plt.yticks([0,1])
    plt.axis('equal')
    return fig
In [ ]:
figs = [equiplot(k) for k in methods]
#demo.savefig(figs, name='demqua01')