Coder Social home page Coder Social logo

ferrall / niqlow Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 11.0 59.06 MB

design, solve and estimate discrete dynamic programs.

Home Page: http://ferrall.github.io/niqlow/

License: Other

HTML 0.38% Ox 43.52% C 38.20% C++ 7.52% Makefile 0.48% Shell 0.20% C# 3.66% Java 2.29% Visual Basic .NET 3.74%
economics ox object-oriented-programming structural-econometrics dynamic-programming mpi-applications replication

niqlow's People

Contributors

ferrall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

niqlow's Issues

BFGS maxiter not working

If I set detergent.ox the maxiter property to

mle.maxiter = 15;

in the detergent.ox file of DCDPdetergent the file does not even complete one iteration. See the newest log file (bfgs_maxiter.log) in the gist

Stage 2 Estimation

I created a new state variable class for my coupon variables and I now have Stage 1 of my estimator working.

Stage 2 if I set EMax.DoNotIterate = TRUE; then I get this log file

The file shows that cur->Outcome::FullLikelihood() = .NaN; which doesn't seem right.

If I set EMax.DoNotIterate = FALSE; I get the stack trace below

error while checking convergence
Runtime error occurred in Update (212), call trace:
 (212): Update
 (549): loop
 (625): Traverse
 (123): Gsolve
 (85): Run
 (229): loop
 (66): Run
 (166): Solve
 (503): LogLikelihood
 (531): LogLikelihood
 (836): EconometricObjective

which is also due to a .NaN value.

Any debugging tips?

Model Convergence / GroupVariables(...)

Current issues:

  1. Solver not converging when I put the consumption FixedState in Endogenous(...)

    Amoeba method of NelderMead gets stuck at a plex size of 0.2 at a variety of starting values. Also tried BFGS and got

    Runtime error: '[-1] in array[4]' index out of range
    Runtime error occurred in Utility (103), call trace:
    detergent.ox (103): Utility
    

    is there anything wrong with my Utility method?

  2. Putting FixedEffect variable in GroupVariables(...) does not seem to work

    Using NelderMead I get

    Plex size tolerance 1e-05
    Amoeba Start
    now: 0
    viinds:
    [0] =
         2.0000
    [1] =
         3.0000
    
    vilikes: 0
    Runtime error: 'matrix[0][0]' cannot cast to double
    Runtime error occurred in PathLike (404), call trace:
    (404): PathLike
    (447): Likelihood
    (515): LogLikelihood
    (532): LogLikelihood
    (862): EconometricObjective
    (550): vfunc
    (345): vobj
    (286): funclist
    (333): Amoeba
    

    using a modified PathLike() method in Outcomes.ox

    /** Integrate over the path.
    
    **/
    Path::PathLike() {
      decl cur, glk;
      now = TRUE;
      print("now: ", !now, "\n");
      print("viinds: ", viinds, "\n");
      print("vilikes: ", vilikes, "\n");
      viinds[!now] = <>;
      vilikes[!now] = <>; // needs to be array - isn't
      print("complete");
      cur = last;
      do {
          tom = !now;
          cur->Outcome::Likelihood();
          now = !now;
          } while(isclass(cur = cur.prev));
      L = double(sumr(vilikes[!now]));
      }
    

    vilikes is an integer and it needs to be a matrix

  3. How long should I expect estimating the model to take if the state space is around 10000 and there are about 1000 households?

  4. Do you know of a way to track the progress of the model on sharcnet (using logging)? When I submit a job on sharcnet I don't get any results until the model times out, completes or crashes because it doesn't write the output to a file until the very end.

PanelPrediction print out

I am still having a problem with histograms in the PanelPrediction output not adding to 1 (though the new average print-out helps). I have replaced the old output file in our branch. Thanks.

Stage 2 Estimation (Peanut Butter data)

I tried estimating Stage 2 (only) of my model and get the following error

Runtime error: 'pandv' member function call requires object
Runtime error occurred in GetPstar (54), call trace: 
 (54): GetPstar
 (376): FullLikelihood
 (447): FullLikelihood
 (508): LogLikelihood
 (525): LogLikelihood
 (859): EconometricObjective
 (555): vfunc
 (350): vobj
 (291): funclist
 (404): Jacobian
 (376): Gradient
remaining calls not listed

The full log file is here. Any idea what's wrong? My model code is on DCDPdetergent.git in the peanut_butter branch.

The dataset is in my sharcnet directory /home/cpritcha/paper/src/data/pbutter.dta

RandomUpDown & UncertainLongevity

I wrote a simplified version of the model to find a few mistakes (I've shared it with you in the github sept directory).

If I set the RandomUpDown to just simply stay constant "(010)", then the predicted histograms add up to 1 until I reach the stationary last period (T-2) at which point the choice probabilities and distributions do not make sense. As soon as I change the RandomUpDown variable so that it increases or decreases with some probability, I begin to "lose" people in predicted distributions in the "age phase" of the model.

Do I need to set up the RandomUpDown probabilities so it checks the current state to see if it is at the max or min value and subsequently adjusts the probabilities to ensure the state variable does not go above the set max value?

Also: I'm not sure how to interpret the transitions when I set the volume to noisy.

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.