coefficient_kd_plot
Function
gme.coefficient_kd_plot(estimation_model: EstimationModel, variables: List[str], path: str = None, bandwidth: float = 0.5, rename_variables: dict = None):
Description
Produce kernel density plots of parameter estimates across different sectors in the results dictionary.
Arguments
- estimation_model: gme.EstimationModel
An estimated EstimationModel with more than one sector.
- variables: List[str]
A list of model covariates for which to plot kernel densities.
- path: (optional) str
A path and file name at which to save the plot. Can end in the following file types for example: pdf, svg, and png.
- bandwidth: float
Specify the bandwidth for the density plots. The default is 0.5.
- rename_variables: (optional)
A dictionary of alternative variable names to use in the plot. For example {'original_name':'new_name'}
Return
None, plots a figure and, if specified, writes it to a file.
Examples
>>> est_model = EstimationModel(est_data, lhs_var='trade_value',
rhs_var=['contiguity', 'agree_pta', 'border', 'colony', 'ln_dist'],
fixed_effects=[['importer', 'year'], ['exporter', 'year']],
sector_by_sector=True)
>>> est_model.estimate()
>>> coefficient_kd_plot(est_model, variables = ['contiguity', 'agree_pta', 'border', 'colony', 'ln_dist'],
rename_variables = {'agree_pta':'PTA', 'ln_dist':'distance'},
path = 'C:\kd_plot.eps')