Coverage for HARK / Labeled / __init__.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-25 05:22 +0000

1""" 

2Labeled consumption-saving models using xarray. 

3 

4This package provides consumption-saving models that use xarray's labeled 

5data structures for clear variable naming and easier manipulation of results. 

6 

7Classes 

8------- 

9ValueFuncCRRALabeled 

10 Value function interpolation using xarray. 

11ConsumerSolutionLabeled 

12 Solution container for labeled models. 

13ConsPerfForesightLabeledSolver 

14 Solver for perfect foresight model. 

15ConsIndShockLabeledSolver 

16 Solver for model with income shocks. 

17ConsRiskyAssetLabeledSolver 

18 Solver for model with risky asset. 

19ConsFixedPortfolioLabeledSolver 

20 Solver for model with fixed portfolio allocation. 

21ConsPortfolioLabeledSolver 

22 Solver for model with optimal portfolio choice. 

23PerfForesightLabeledType 

24 Agent type for perfect foresight. 

25IndShockLabeledType 

26 Agent type with income shocks. 

27RiskyAssetLabeledType 

28 Agent type with risky asset. 

29PortfolioLabeledType 

30 Agent type with portfolio choice. 

31 

32Functions 

33--------- 

34make_solution_terminal_labeled 

35 Create terminal period solution. 

36make_labeled_inc_shk_dstn 

37 Create labeled income shock distribution. 

38make_labeled_risky_dstn 

39 Create labeled risky return distribution. 

40make_labeled_shock_dstn 

41 Create labeled joint shock distribution. 

42""" 

43 

44from .agents import ( 

45 IndShockLabeledType, 

46 PerfForesightLabeledType, 

47 PortfolioLabeledType, 

48 RiskyAssetLabeledType, 

49) 

50from .config import ( 

51 IND_SHOCK_CONFIG, 

52 PERF_FORESIGHT_CONFIG, 

53 PORTFOLIO_CONFIG, 

54 RISKY_ASSET_CONFIG, 

55 ModelConfig, 

56 get_config, 

57) 

58from .factories import ( 

59 make_labeled_inc_shk_dstn, 

60 make_labeled_risky_dstn, 

61 make_labeled_shock_dstn, 

62 make_solution_terminal_labeled, 

63) 

64from .solution import ConsumerSolutionLabeled, ValueFuncCRRALabeled 

65from .solvers import ( 

66 BaseLabeledSolver, 

67 ConsFixedPortfolioLabeledSolver, 

68 ConsIndShockLabeledSolver, 

69 ConsPerfForesightLabeledSolver, 

70 ConsPortfolioLabeledSolver, 

71 ConsRiskyAssetLabeledSolver, 

72) 

73from .transitions import ( 

74 FixedPortfolioTransitions, 

75 IndShockTransitions, 

76 PerfectForesightTransitions, 

77 PortfolioTransitions, 

78 RiskyAssetTransitions, 

79 Transitions, 

80) 

81 

82__all__ = [ 

83 # Solution classes 

84 "ValueFuncCRRALabeled", 

85 "ConsumerSolutionLabeled", 

86 # Solvers 

87 "BaseLabeledSolver", 

88 "ConsPerfForesightLabeledSolver", 

89 "ConsIndShockLabeledSolver", 

90 "ConsRiskyAssetLabeledSolver", 

91 "ConsFixedPortfolioLabeledSolver", 

92 "ConsPortfolioLabeledSolver", 

93 # Transitions 

94 "Transitions", 

95 "PerfectForesightTransitions", 

96 "IndShockTransitions", 

97 "RiskyAssetTransitions", 

98 "FixedPortfolioTransitions", 

99 "PortfolioTransitions", 

100 # Agent types 

101 "PerfForesightLabeledType", 

102 "IndShockLabeledType", 

103 "RiskyAssetLabeledType", 

104 "PortfolioLabeledType", 

105 # Factories 

106 "make_solution_terminal_labeled", 

107 "make_labeled_inc_shk_dstn", 

108 "make_labeled_risky_dstn", 

109 "make_labeled_shock_dstn", 

110 # Config 

111 "ModelConfig", 

112 "PERF_FORESIGHT_CONFIG", 

113 "IND_SHOCK_CONFIG", 

114 "RISKY_ASSET_CONFIG", 

115 "PORTFOLIO_CONFIG", 

116 "get_config", 

117]