Skip to content

Commit

Permalink
Merge branch 'master' into i446
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Feb 24, 2020
2 parents 21aa63f + e1b52e5 commit 525cb7e
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ def checkRIC(self, thorn,verbose,public_call):
Evaluate and report on the Return Impatience Condition
'''

RIF = Thorn/self.Rfree
RIF = thorn/self.Rfree
self.RIF = RIF
if RIF<1:
self.RIC = True
Expand Down Expand Up @@ -1963,9 +1963,9 @@ def checkFHWC(self,verbose,public_call):
if verbose:
print('Therefore, the limiting consumption function is c(m)=Infinity for all m')
print()
if verbose and violated and verbose_reference:
if verbose and self.violated and verbose_reference:
print('[!] For more information on the conditions, see Table 3 in "Theoretical Foundations of Buffer Stock Saving" at http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory/')
return violated
return self.violated



Expand Down Expand Up @@ -1996,7 +1996,7 @@ def checkConditions(self,verbose=False,verbose_reference=False,public_call=False
return

Thorn = (self.Rfree*self.DiscFac*self.LivPrb[0])**(1/self.CRRA)
self.Thorn = thorn
self.Thorn = Thorn

self.checkAIC(Thorn,verbose,public_call)
self.checkGICPF(Thorn,verbose,public_call)
Expand Down Expand Up @@ -2319,15 +2319,15 @@ def checkGICInd(self,Thorn,verbose,public_call):
if public_call or verbose:
print('The value of the Individual Growth Impatience Factor for the supplied parameter values satisfies the Individual Growth Impatience Condition.', end = " ")
if verbose:
print('Therefore, a target level of the individual market resources ratio m exists (see '+url+'/#onetarget for more).')
print('Therefore, a target level of the individual market resources ratio m exists (see '+self.url+'/#onetarget for more).')
print()
else:
self.GICInd = False
self.violated = True
print('The given parameter values violate the Individual Growth Impatience Condition; the GIFInd is: %2.4f' % (self.GIFInd), end = " ")
if verbose:
print('')
print('Therefore, a target ratio of individual market resources to individual permanent income does not exist. (see '+url+'/#onetarget for more).')
print('Therefore, a target ratio of individual market resources to individual permanent income does not exist. (see '+self.url+'/#onetarget for more).')
print()

def checkCIGAgg(self, Thorn,verbose,public_call):
Expand Down Expand Up @@ -2358,15 +2358,15 @@ def checkWRIC(self, verbose,public_call):
if WRIF<=1:
self.WRIC = True
if public_call or verbose:
print('The Weak Return Impatience Factor value for the supplied parameter values satisfies the Weak Return Impatience Condition (see '+url+'/#WRIC for more).')
print('The Weak Return Impatience Factor value for the supplied parameter values satisfies the Weak Return Impatience Condition (see '+self.url+'/#WRIC for more).')
print()
else:
self.WRIC = False
self.violated = True
print('The given type violates the Weak Return Impatience Condition with the supplied parameter values. The WRIF is: %2.4f' % (WRIF), end = " ")
if verbose:
print('')
print('Therefore, a nondegenerate solution is not available (see '+url+'/#WRIC for more.')
print('Therefore, a nondegenerate solution is not available (see '+self.url+'/#WRIC for more.')
print()

def checkFVAC(self,verbose,public_call):
Expand Down Expand Up @@ -2394,7 +2394,7 @@ def checkFVAC(self,verbose,public_call):
print('The given type violates the Finite Value of Autarky Condition with the supplied parameter values. The FVAF is %2.4f' %(FVAF), end = " ")
self.violated = True
if public_call or verbose:
print('Therefore, a nondegenerate solution is not available (see '+url+'/#Conditions-Under-Which-the-Problem-Defines-a-Contraction-Mapping')
print('Therefore, a nondegenerate solution is not available (see '+self.url+'/#Conditions-Under-Which-the-Problem-Defines-a-Contraction-Mapping')
print()


Expand All @@ -2419,15 +2419,15 @@ def checkConditions(self,verbose=False,public_call=True):
-------
None
'''
violated = False # PerfForesightConsumerType.checkConditions(self, verbose=False, verbose_reference=False)
self.violated = False # PerfForesightConsumerType.checkConditions(self, verbose=False, verbose_reference=False)

if self.cycles!=0 or self.T_cycle > 1:
return

# For theory, see hyperlink targets to expressions in
# url=http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory
# For example, the hyperlink to the relevant section of the paper
url='http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory'
self.url='http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory'
# would be referenced below as:
# [url]/#Uncertainty-Modified-Conditions

Expand Down Expand Up @@ -2460,9 +2460,10 @@ def checkConditions(self,verbose=False,public_call=True):
self.checkGICInd(Thorn,verbose,public_call)
self.checkCIGAgg(Thorn,verbose,public_call)
self.checkWRIC(verbose,public_call)
self.checkFVAC(verbose, public_call)

if verbose and self.violated:
print('\n[!] For more information on the conditions, see Tables 3 and 4 in "Theoretical Foundations of Buffer Stock Saving" at '+url+'/#Factors-Defined-And-Compared')
print('\n[!] For more information on the conditions, see Tables 3 and 4 in "Theoretical Foundations of Buffer Stock Saving" at '+self.url+'/#Factors-Defined-And-Compared')
print('')

if verbose:
Expand All @@ -2471,9 +2472,9 @@ def checkConditions(self,verbose=False,public_call=True):
print('GIFAgg = %2.6f ' % (GIFAgg))
print('Thorn = AIF = %2.6f ' % (Thorn))
print('PermGroFacAdj = %2.6f ' % (PermGroFacAdj))
print('uInvEpShkuInv = %2.6f ' % (uInvEpShkuInv))
print('FVAF = %2.6f ' % (FVAF))
print('WRIF = %2.6f ' % (WRIF))
print('uInvEpShkuInv = %2.6f ' % (self.uInvEpShkuInv))
print('FVAF = %2.6f ' % (self.FVAF))
print('WRIF = %2.6f ' % (self.WRIF))
print('DiscFacGIFIndMax = %2.6f ' % (self.DiscFacGIFIndMax))
print('DiscFacGIFAggMax = %2.6f ' % (self.DiscFacGIFAggMax))

Expand Down

2 comments on commit 525cb7e

@llorracc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes thorn is capitalized and sometimes not. We should be consistent about that. I'll approve a PR that fixes it.

@sbenthall
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made an issue for this and other fixes here:
#542

Please sign in to comment.