pyValEIA.stats.skill_score ========================== .. py:module:: pyValEIA.stats.skill_score .. autoapi-nested-parse:: Functions to calculate skill score statistics. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyValEIA.stats.skill_score.state_check pyValEIA.stats.skill_score.coin_toss_state pyValEIA.stats.skill_score.liemohn_skill_score pyValEIA.stats.skill_score.calc_pc_and_csi Module Contents --------------- .. py:function:: state_check(truth_vals, test_vals, event_val='eia') Calculate the skill state of an observation against truth. :Parameters: **truth_vals** : array-like Array of values to compare to `event_val` specifying the truth status to test against **test_vals** : array-like Array of values to compare to `event_val` specifying the data status to test against the truth **event_val** : str, int, or float Value specifying the state indicating a positive event (default='eia') :Returns: **event_states** : array-like Categories of skill score states corresponding to the combination of test and truth values for the desired event value :Raises: ValueError If `test_vals` and `truth_vals` are different lengths .. rubric:: Notes The skill score states are: - H: hit - M: miss - C: correct negative - F: false alarm .. !! processed by numpydoc !! .. py:function:: coin_toss_state(event_states) Calcualte the event states needed for a coin toss outcome. :Parameters: **event_states** : array-like Array of event states 'H', 'M', 'F', and 'C' that will be used to create a coin-toss model of the same size and proportion of truth states :Returns: **hit** : int Number of hits for the coin toss model **miss** : int Number of misses for the coin toss model **falarm** : int Number of false alarms for the coin toss model **corneg** : int Number of correct negatives for the coin toss model .. !! processed by numpydoc !! .. py:function:: liemohn_skill_score(event_states, coin=False) Calcualte the Liemohn skill scores using the skill event states. :Parameters: **event_states** : array-like array of event states 'H', 'M', 'F', and 'C' **coin** : bool if True, returns will be LSS for a coin if False, returns will be LSS of event_states (default) **Returns** .. **-------** .. **LSS1** : double Liemohn Skill Score 1 **LSS2** : double Liemohn Skill Score 2 **LSS3** : double Liemohn Skill Score 3 **LSS4** : double Liemohn Skill Score 4 .. seealso:: :obj:`state_check` .. .. rubric:: References Liemohn 2025 under review .. only:: latex .. !! processed by numpydoc !! .. py:function:: calc_pc_and_csi(event_states, coin=False) Calculate the percent correct and critical success index. :Parameters: **event_states** : array-like array of event states 'H', 'M', 'F', and 'C' **coin** : bool if True, returns will be LSS for a coin if False, returns will be LSS of event_states :Returns: **pcor** : double percent correct as a decimal between 0 and 1 **cs_ind** : double critical success index as a decimal between 0 and 1 .. !! processed by numpydoc !!