GithubHelp home page GithubHelp logo

darkolo's Issues

BufferStock dolo: "too many indices for array"

Error in BufferStock python code.

I'm getting this error both when running:

$ ipython BufferStock.py

and when runnign
$ jupytext --to notebook BufferStock.py and then opening the notebook with Jupyter.

In cell 5, # Set a maximum value of the market resources ratio m for use in both models

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-5-e81ae8575e02> in <module>
      5 
      6 # Obtain the decision rule by time iteration
----> 7 dr = time_iteration(model_dolo,tol=1e-08,verbose=True)

~/projects/econ-ark/dolo/dolo/algos/time_iteration.py in time_iteration(model, dr0, dprocess, with_complementarities, verbose, grid, maxit, inner_maxit, tol, hook, details)
     84     n_s = len(model.symbols['states'])
     85 
---> 86     endo_grid = model.get_grid(**grid)
     87 
     88     exo_grid = dprocess.grid

~/projects/econ-ark/dolo/dolo/compiler/model.py in get_grid(self)
    190         # determine bounds:
    191         domain = self.get_domain()
--> 192         min = domain.min
    193         max = domain.max
    194 

~/projects/econ-ark/dolo/dolo/compiler/objects.py in min(self)
     27     @property
     28     def min(self):
---> 29         return np.array([self[e][0] for e in self.states])
     30 
     31     @property

~/projects/econ-ark/dolo/dolo/compiler/objects.py in <listcomp>(.0)
     27     @property
     28     def min(self):
---> 29         return np.array([self[e][0] for e in self.states])
     30 
     31     @property

IndexError: too many indices for array

python -> dolo version of BST

Originally from #14

Add to the BST chimera a python script that generates the object created by the dolang compiler when it parses the BST YAML.

BufferStock chimera improvements

Improvements to the BufferStock DARKolo:

  • Commit modifications made at NumFOCUS summit
  • Explain each part of the dolang model
  • Bring the section on "Upper and Lower Limits of the Marginal Propensity to Consume" from the BufferStock REMARK into this DARKolo
  • Look for other parts of the BufferStock REMARK that correspond to the dolang model

This completes the BufferStock section of this issue:
econ-ark/HARK#414

A proposed structure for the representation of discrete and continuous objects

@sbenthall , @albop

I've been thinking about the practicalities of how we might keep track of functions of arbitrary numbers of discrete and continuous dimensions, and wanted to make a proposal intended to start a conversation on that subject.

https://github.com/econ-ark/DARKolo/blob/master/development/Representing_Multidimensional_Discrete-Continuous.ipynb

This is not meant as a concrete proposal, more as just an initial set of thoughts meant to provoke a discussion.

working out an expanded Dolo/DolARK syntax

From @llorracc

A high priority from my point of view is working out an expanded Dolo/DolARK syntax so that we can capture:

  1. "Cycles" in which the agents solve a different problem in each subperiod
  2. Finite Horizons specification of the SolvingMicroDSOPs life cycle model that has age-varying magnitudes of transitory and permanent shocks, income growth, and other inputs
  3. "Absolute time" A way to make reference to some absolute time (like, what year is it, in addition to what age am I). This is much less important, and if hard to do could be dropped
  4. Conventions for how to keep track of agents who are "ex-ante" heterogeneous so that we can develop tools for handling such populations efficiently.

We should probably move a summary of this discussion to GitHub so it will be easy to track down in the future when we need to reference it.

BufferStock: is unemployment part of the model?

@llorracc I'm confused about the parameterization of the buffer stock model here.

The original paper, and the REMARK, both explicitly model unemployment shocks.

This chimera notebook says "The unemployment (zero-income event) shocks are turned off". This is consistent with the equations given but not consistent with the parameters given in the first table or in the HARK model code, which still have the πš„πš—πšŽπš–πš™π™Ώπš›πš‹ and π™Έπš—πšŒπš„πš—πšŽπš–πš™ variables.

There is also a note that "An explicit liqudity constraint is added (ct≀mtct≀mt); that is, the consumer is prohibited from borrowing". But I don't believe this constraint is written into the equations above this line.

My reading is that the "For the purposes of this notebook..." section is meant to override what comes prior to it and was perhaps added without editing other code brought in from other sources. But I wanted to double check that I understood the intended model before making edits accordingly and bringing in simulation code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.