From c4865d0adadfa4bce421af97e9721386d3af5a32 Mon Sep 17 00:00:00 2001 From: mhjensen Date: Wed, 9 May 2018 16:44:52 -0400 Subject: [PATCH] revising models --- doc/Programs/Finance/agents.py | 10 +- .../How2ReadData/html/How2ReadData-bs.html | 1518 +++++++++++++++- .../html/How2ReadData-reveal.html | 730 +++++++- .../html/How2ReadData-solarized.html | 778 +++++++- doc/pub/How2ReadData/html/How2ReadData.html | 778 +++++++- doc/pub/How2ReadData/ipynb/How2ReadData.ipynb | 911 +++++++++- .../ipynb/ipynb-How2ReadData-src.tar.gz | Bin 113365 -> 113365 bytes .../pdf/How2ReadData-beamer-handouts2x3.pdf | Bin 300762 -> 391446 bytes .../How2ReadData/pdf/How2ReadData-beamer.pdf | Bin 273591 -> 362874 bytes .../How2ReadData/pdf/How2ReadData-minted.pdf | Bin 333810 -> 398856 bytes doc/src/How2ReadData/How2ReadData.do.txt | 613 +------ doc/src/How2ReadData/backup.do.txt | 1616 +++++++++++++++++ doc/src/Statistics/make.sh | 50 +- 13 files changed, 6021 insertions(+), 983 deletions(-) create mode 100644 doc/src/How2ReadData/backup.do.txt diff --git a/doc/Programs/Finance/agents.py b/doc/Programs/Finance/agents.py index 863a52889..fad71e19b 100644 --- a/doc/Programs/Finance/agents.py +++ b/doc/Programs/Finance/agents.py @@ -7,9 +7,9 @@ import random # initialize the rng with a seed random.seed() # Hard coding of input parameters -Agents = 100 +Agents = 500 MCcounts = 1000 -Transactions = 10000 +Transactions = 100000 startMoney = 1.0 Lambda = 0.0 FinancialAgents = startMoney*np.ones(Agents) @@ -19,17 +19,17 @@ for i in range (1, MCcounts, 1): agent_j = int(Agents*random.random()) epsilon = random.random() if agent_i != agent_j: - m1 = Lambda*FinancialAgents[agent_i] + (1-Lambda)*epsilon* (FinancialAgents[agent_i] + FinancialAgents[agent_j]) + m1 = Lambda*FinancialAgents[agent_i] + (1-Lambda)*epsilon*(FinancialAgents[agent_i] + FinancialAgents[agent_j]) m2 = Lambda*FinancialAgents[agent_j] + (1-Lambda)*(1-epsilon)*(FinancialAgents[agent_i] + FinancialAgents[agent_j]) FinancialAgents[agent_i] = m1 FinancialAgents[agent_j] = m2 # the histogram of the data -n, bins, patches = plt.hist(FinancialAgents, 20, facecolor='green') +n, bins, patches = plt.hist(FinancialAgents, 50, facecolor='green') plt.xlabel('$x$') plt.ylabel('Distribution of wealth') plt.title(r'Money') -plt.axis([0, 10, 0, 100]) +plt.axis([0, 10, 0, 500]) plt.grid(True) plt.show() diff --git a/doc/pub/How2ReadData/html/How2ReadData-bs.html b/doc/pub/How2ReadData/html/How2ReadData-bs.html index 6e51e7e7a..2997777e7 100644 --- a/doc/pub/How2ReadData/html/How2ReadData-bs.html +++ b/doc/pub/How2ReadData/html/How2ReadData-bs.html @@ -40,9 +40,9 @@ Automatically generated HTML file from DocOnce source @@ -88,7 +116,7 @@ end of tocinfo -->