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

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