pyfan.table.reg.txt2textab

The pyfan.stats.markov.transprobcheck checks markov transition row sums.

A markov transition matrix where each row does not sum up to 1 due to simulation errors. Check if the gap between 1 and the row values are too big, and then normalize.

import pyfan.stats.markov.transprobcheck as pyfan_stats_transprobcheck

Includes method markov_trans_prob_check() and markov_condi_prob2one().

Module Contents

Functions

tab_txt2tex_f2f(spt_root='', st_rglob='tab_*_fmd.md', **kwargs)

tab_txt2tex(ls_st_txt_regs, it_col_count=6, fl_adj_box_maxwidth=1, it_or_dc_round_decimal=2, fl_col_label_width_cm=5, fl_col_coef_width_cm=2, fl_indent_pound1_mm=0, fl_indent_pound2_mm=0, fl_indent_pound3_mm=6)

Markov conditional transition probability check

pyfan.table.reg.txt2textab.tab_txt2tex_f2f(spt_root='', st_rglob='tab_*_fmd.md', **kwargs)[source]
pyfan.table.reg.txt2textab.tab_txt2tex(ls_st_txt_regs, it_col_count=6, fl_adj_box_maxwidth=1, it_or_dc_round_decimal=2, fl_col_label_width_cm=5, fl_col_coef_width_cm=2, fl_indent_pound1_mm=0, fl_indent_pound2_mm=0, fl_indent_pound3_mm=6)[source]

Markov conditional transition probability check

Parameters
it_col_countint

Number of latex table columns

fl_atol_per_rowfloat, optional

Tolerance for the difference between 1 and each row sum

fl_atol_avg_rowfloat, optional

Tolerance for the difference between 1 and average of row sums

fl_sum_to_matchfloat, optional

This should be 1, unless the function is not used to handle transition matrixes

Returns
——-
list string formated to tex to return

A tuple of booleans, the fiit element is if satisfies the overall criteria. Second is if satisifes the per_row condition. Third if satisfies the average criteria.

Examples

# >>> mt_ar1_trans = np.array([[0.4334, 0.5183, 0.0454], # >>> [0.2624, 0.5967, 0.1245], # >>> [0.1673, 0.5918, 0.2005]]) # >>> bl_ar1_sum_pass, bl_per_row_pass, bl_avg_row_pass = markov_trans_prob_check(mt_ar1_trans) # >>> print(f’{bl_ar1_sum_pass=}’) # bl_ar1_sum_pass=False # >>> print(f’{bl_per_row_pass=}’) # bl_per_row_pass=False # >>> print(f’{bl_avg_row_pass=}’) bl_avg_row_pass=False

pyfan.table.reg.txt2textab.spt_root = C:/Users/fan/Box/Pollution and inequality/drafts/paper_final_tab/[source]