Skip to content

Commit

Permalink
Updated files to run for sphinx-docs. Added absolute path calls to ma…
Browse files Browse the repository at this point in the history
…ny files.
  • Loading branch information
compumetrika committed Jun 21, 2016
1 parent da52860 commit cc4564e
Show file tree
Hide file tree
Showing 157 changed files with 106 additions and 26,075 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/generated/

# PyBuilder
target/
Expand Down
7 changes: 5 additions & 2 deletions ConsumptionSavingModel/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
See HARK documentation for mathematical descriptions of the models being solved.
'''
import sys
sys.path.insert(0,'../')
import os
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('./'))
#sys.path.insert(0,'../')

from copy import copy, deepcopy
import numpy as np
Expand Down Expand Up @@ -2368,4 +2371,4 @@ def constructAssetsGrid(parameters):
KinkyExample.initializeSim()
KinkyExample.simConsHistory()



7 changes: 5 additions & 2 deletions FashionVictim/FashionVictimModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
'''

import sys
sys.path.insert(0,'../')
#sys.path.insert(0,'../')
import os
sys.path.insert(0, os.path.abspath('../'))

from HARKcore import AgentType, Solution, NullFunc
from HARKinterpolation import LinearInterp
from HARKutilities import approxUniform, plotFuncs
Expand Down Expand Up @@ -477,4 +480,4 @@ def calcFashionEvoFunc(pPop):

TestMarket.solve()
plt.plot(TestMarket.pPop_hist)
plt.show()
plt.show()
Empty file added FashionVictim/__index__.py
Empty file.
11 changes: 7 additions & 4 deletions SolvingMicroDSOPs/SetupSCFdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
# Import the HARK library. The assumption is that this code is in a folder
# contained in the HARK folder.
import sys
sys.path.insert(0,'../')
#sys.path.insert(0,'../')
import os
sys.path.insert(0, os.path.abspath('../'))


# The following libraries are part of the standard python distribution
import numpy as np # Numerical Python
Expand All @@ -17,10 +20,10 @@
from HARKutilities import warnings

# Set the path to the empirical data:
scf_data_path = './'
scf_data_path = data_location = os.path.dirname(os.path.abspath(__file__)) # os.path.abspath('./') #'./'

# Open the file handle and create a reader object and a csv header
infile = open(scf_data_path + 'SCFdata.csv', 'rb')
infile = open(scf_data_path + '/SCFdata.csv', 'rb')
csv_reader = csv.reader(infile)
data_csv_header = csv_reader.next()

Expand Down Expand Up @@ -62,4 +65,4 @@
print("This module is imported by StructEstimation, providing data for")
print("the example estimation. Please see that module if you want more")
print("interesting output.")


8 changes: 6 additions & 2 deletions SolvingMicroDSOPs/StructEstimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
# Import the HARK library. The assumption is that this code is in a folder
# contained in the HARK folder.
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'../ConsumptionSavingModel')
#sys.path.insert(0,'../')
#sys.path.insert(0,'../ConsumptionSavingModel')
import os
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../ConsumptionSavingModel'))


import EstimationParameters as Params # Parameters for the consumer type and the estimation
import ConsIndShockModel as Model # The consumption-saving micro model
Expand Down
Empty file added SolvingMicroDSOPs/__index__.py
Empty file.
10 changes: 6 additions & 4 deletions cstwMPC/SetupParamsCSTW.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import csv
from copy import copy, deepcopy
import os

# Choose percentiles of the data to match and which estimation to run
do_lifecycle = False # Use lifecycle model if True, perpetual youth if False
Expand Down Expand Up @@ -59,7 +60,8 @@
PermShkStd = np.ndarray.tolist(PermShkStd)

# Import survival probabilities from SSA data
f = open('USactuarial.txt','r')
data_location = os.path.dirname(os.path.abspath(__file__))
f = open(data_location + '/' + 'USactuarial.txt','r')
actuarial_reader = csv.reader(f,delimiter='\t')
raw_actuarial = list(actuarial_reader)
base_death_probs = []
Expand All @@ -68,7 +70,7 @@
f.close

# Import adjustments for education and apply them to the base mortality rates
f = open('EducMortAdj.txt','r')
f = open(data_location + '/' + 'EducMortAdj.txt','r')
adjustment_reader = csv.reader(f,delimiter=' ')
raw_adjustments = list(adjustment_reader)
d_death_probs = []
Expand Down Expand Up @@ -184,7 +186,7 @@
intercept_prev = 0.0 # Initial intercept of kNextFunc (aggregate shocks model)

# Import the SCF wealth data
f = open(SCF_data_file,'r')
f = open(data_location + '/' + SCF_data_file,'r')
SCF_reader = csv.reader(f,delimiter='\t')
SCF_raw = list(SCF_reader)
SCF_wealth = np.zeros(len(SCF_raw)) + np.nan
Expand Down Expand Up @@ -291,4 +293,4 @@
print("Sorry, SetupParamsCSTW doesn't actually do anything on its own.")
print("This module is imported by cstwMPC, providing data and calibrated")
print("parameters for the various estimations. Please see that module if")
print("you want more interesting output.")
print("you want more interesting output.")
Empty file added cstwMPC/__index__.py
Empty file.
12 changes: 9 additions & 3 deletions cstwMPC/cstwMPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
# Import the HARK library. The assumption is that this code is in a folder
# contained in the HARK folder. Also import ConsumptionSavingModel
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'../ConsumptionSavingModel')
import os
#sys.path.insert(0,'../')
#sys.path.insert(0,'../ConsumptionSavingModel')

sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../ConsumptionSavingModel'))



import numpy as np
from copy import deepcopy
Expand Down Expand Up @@ -857,4 +863,4 @@ def betaDistObjective(nabla):
agg_shock_weights = np.concatenate((np.zeros(200),np.ones(Params.sim_periods_agg_shocks-200)))
agg_shock_weights = agg_shock_weights/np.sum(agg_shock_weights)
makeCSTWstats(beta_agg,nabla_agg,agg_shocks_type_list,agg_shock_weights)


7 changes: 0 additions & 7 deletions doc-example/ConsPrefShockModel_old.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/ConsumptionSavingModel.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/ConsumptionSavingModel_old.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/MarkovExamples.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/SetupConsumerParameters.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/SetupPrefShockConsParameters.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/SolvingMicroDSOPs.rst

This file was deleted.

7 changes: 0 additions & 7 deletions doc-example/SolvingMicroDSOPs_old.rst

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed doc-example/_build/doctrees/HARKcore.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/HARKestimation.doctree
Binary file not shown.
Binary file not shown.
Binary file removed doc-example/_build/doctrees/HARKparallel.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/HARKsimulation.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/HARKutilities.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/MarkovExamples.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/MultithreadDemo.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed doc-example/_build/doctrees/SetupSCFdata.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed doc-example/_build/doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed doc-example/_build/doctrees/index.doctree
Binary file not shown.
Binary file removed doc-example/_build/doctrees/modules.doctree
Binary file not shown.
4 changes: 0 additions & 4 deletions doc-example/_build/html/.buildinfo

This file was deleted.

96 changes: 0 additions & 96 deletions doc-example/_build/html/ConsAggShockModel.html

This file was deleted.

Loading

0 comments on commit cc4564e

Please sign in to comment.