<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calculate_parameters_with_confidence(self, independentTs, dependentTs, confidenceLevel, samplePercentage=.1):
 """Same functionality as calculate_parameters, just that additionally the confidence interval for a given confidenceLevel is calculated. This is done based on a sample of the dependentTs training data that is validated against the prediction. The signed error of the predictions and the sample is then used to calculate the bounds of the interval. further reading: http://en.wikipedia.org/wiki/Confidence_interval :param Timeseries independentTs: The Timeseries used for the independent variable (x-axis). The Timeseries must have at least 2 datapoints with different dates and values :param Timeseries dependentTs: The Timeseries used as the dependent variable (y-axis). The Timeseries must have at least 2 datapoints, which dates match with independentTs :param float confidenceLevel: The percentage of entries in the sample that should have an prediction error closer or equal to 0 than the bounds of the confidence interval. :param float samplePercentage: How much of the dependentTs should be used for sampling :return: A tuple containing the y-axis intercept and the slope used to execute the regression and the (underestimation, overestimation) for the given confidenceLevel :rtype: tuple :raise: Raises an :py:exc:`ValueError` if - independentTs and dependentTs have not at least two matching dates - independentTs has only one distinct value - The dates in one or both Timeseries are not distinct. """

        #First split the time series into sample and training data
        sampleY, trainingY = dependentTs.sample(samplePercentage)

        sampleX_list = self.match_time_series(sampleY, independentTs)[1]
        trainingX_list = self.match_time_series(trainingY, independentTs)[1]

        sampleX = TimeSeries.from_twodim_list(sampleX_list)
        trainingX = TimeSeries.from_twodim_list(trainingX_list)

        #Then calculate parameters based on the training data
        n, m = self.calculate_parameters(trainingX, trainingY)

        #predict
        prediction = self.predict(sampleX, n, m)

        #calculate the signed error at each location, note that MSD(x,y) != MSD(y,x)
        msd = MSD()
        msd.initialize(prediction, sampleY)

        return (n, m, msd.confidence_interval(confidenceLevel))