News for hackers. Stuff that matters.
Re:Quantitative Economic Modeling in Python by bfe on Thursday September 26, 2013 @12:08PM (#6451690)
From their page on Optimal Taxation:

    # == Test that nu has a real solution before assigning == #
    warning_msg = """
    Hint: you probably set government spending too {}.  Elect a {}
    Congress and start over.
    """
    disc = a0**2 - 4 * a0 * b0
    if disc >= 0:  
        nu = 0.5 * (a0 - sqrt(disc)) / a0
    else:
        print "There is no Ramsey equilibrium for these parameters."
        print warning_msg.format('high', 'Republican')
        sys.exit(0)

    # == Test that the Lagrange multiplier has the right sign == #
    if nu * (0.5 - nu) < 0:  
        print "Negative multiplier on the government budget constraint."
        print warning_msg.format('low', 'Democratic')
        sys.exit(0)

There are no comments on this comment yet.