Analysis¶
In this module, the function get_dataset retrieves a synthetic (fake) dataset. The class Results offers a few functions to summarize and merge the data, as well as assess preparedness for retirement.
- CPR.analysis.get_dataset()¶
Function that returns a dataframe of synthetic data.
- Returns
Dataframe of synthetic data.
- Return type
pandas.core.frame.DataFrame
- class CPR.analysis.Results(input_data, output, common, prices, extra_params)¶
This class prepares the results.
- Parameters
input_data (pandas.core.frame.DataFrame) – dataframe of inputs
output (pandas.core.frame.DataFrame) – dataframe of outputs
common (Common) – instance of the class Common
prices (Prices) – instance of the class Prices
extra_params (dict) – dictionary of extra parameters
- summarize()¶
Function to summarize the simulation.
- merge(add_index=True)¶
Function to merge input and output variables to create a database.
- Parameters
add_index (bool, optional) – add index to database, True by default
- check_preparedness(factor_couple=2, cons_floor=100, d_cutoffs={20: 80, 100: 65})¶
Function that introduces a consumption floor, computes RRI (NaN if consumption before and after retirement below cons_floor), and checks preparedness for retirement.
- Parameters
factor_couple (int, optional) – factor to normalize income for couple, by default 2
cons_floor (int, optional) – consumption floor, by default 100
d_cutoffs (dict, optional) – cutoffs, by default {20: 80, 100: 65}