def performance_ratio(E, H_poa, P_ref, G_ref=1000):
    """
    Compute performance ratio defined as:

    :math:`PR=\\dfrac{Y_{f}}{Yr} = \\dfrac{\\dfrac{E}{P_{ref}}}{\\dfrac{H_{poa}}{G_{ref}}}`
    
    where 
    :math:`Y_f` is the observed energy (AC or DC) produced by the PV system (kWh) 
    divided by the DC power rating at STC conditions.
    :math:`Y_r` is the plane-of-array insolation (kWh/m2) divided 
    by the reference irradiance (1000 W/m2).
    
    Parameters
    -----------
    E : pandas Series or float
        Energy (AC or DC) 
        
    H_poa : pandas Series or float
         Plane of array insolation
         
    P_ref : float
        DC power rating at STC conditions
        
    G_ref : float (optional)
        Reference irradiance, default = 1000
        
    Returns
    -------
    pandas Series or float
        Performance ratio in a pandas Series (if E or H_poa are Series) or 
        float (if E and H_poa are floats) 
    """
    Yf = E / P_ref
    Yr = H_poa / G_ref
    PR = Yf / Yr
    return PR
