def odds_ratio_skill_score(contingency, yes_category=2):
    """ 
        Returns the odds ratio skill score given dichotomous contingency data 
        Author: Dougie Squire
        Date: 12/05/2018
        
        Parameters
        ----------
        contingency : xarray DataArray
            A 2 category contingency table of the form output from doppyo.skill.contingency
        success_ratio : value, optional
            The coordinate value of the category corresponding to 'yes'
            
        Returns
        -------
        odds_ratio_skill_score : xarray DataArray
            An array containing the equitable odds ratio skill scores
            
        Examples
        --------
        >>> da_cmp = xr.DataArray(np.random.normal(size=(3,3)), 
        ...                       coords=[('x', np.arange(3)), ('y', np.arange(3))])
        >>> da_ref = xr.DataArray(np.random.normal(size=(3,3)), 
        ...                       coords=[('x', np.arange(3)), ('y', np.arange(3))])
        >>> category_edges_cmp = np.linspace(-2,2,3)
        >>> category_edges_ref = np.linspace(-2,2,3)
        >>> contingency = doppyo.skill.contingency(da_cmp, da_ref, category_edges_cmp, 
        ...                                        category_edges_ref, over_dims='y')
        >>> doppyo.skill.odds_ratio_skill_score(contingency)
        <xarray.DataArray 'odds_ratio_skill' (x: 3)>
        array([-1., -1., nan])
        Coordinates:
          * x        (x) int64 0 1 2

        Notes
        -----
        See http://www.cawcr.gov.au/projects/verification/
    """
    no_category = abs(yes_category - 2) + 1
    if len(contingency.comparison_category) > 2:
        raise ValueError(
            'Odd ratio skill score is defined for dichotomous contingency data only'
            )
    hits = contingency.sel(comparison_category=yes_category,
        reference_category=yes_category, drop=True)
    correct_negs = contingency.sel(comparison_category=no_category,
        reference_category=no_category, drop=True)
    misses = contingency.sel(comparison_category=no_category,
        reference_category=yes_category, drop=True)
    false_alarms = contingency.sel(comparison_category=yes_category,
        reference_category=no_category, drop=True)
    return ((hits * correct_negs - misses * false_alarms) / (hits *
        correct_negs + misses * false_alarms)).rename('odds_ratio_skill')
