Fits an AR(1) + GARCH(1, 1) model to the given time series.
    
    Parameters
    ----------
    ts:
        the time series to which we want to fit a AR+GARCH model as a Numpy array
        
    Returns an ARGARCH model

def fit_model(ts, sc=None):
    """
    Fits an AR(1) + GARCH(1, 1) model to the given time series.
    
    Parameters
    ----------
    ts:
        the time series to which we want to fit a AR+GARCH model as a Numpy array
        
    Returns an ARGARCH model
    """
    assert sc != None, "Missing SparkContext"
    
    jvm = sc._jvm
    jmodel = jvm.com.cloudera.sparkts.models.ARGARCH.fitModel(_py2java(sc, Vectors.dense(ts)))
    return ARGARCHModel(jmodel=jmodel, sc=sc)