fit_shifted_cosine

forest.benchmarking.analysis.fit_shifted_cosine(x: numpy.ndarray, y: numpy.ndarray, weights: numpy.ndarray = None, param_guesses: tuple = (0.5, 0, 0.5, 1.0)) → lmfit.model.ModelResult

Fit experimental data x, y to a cosine shifted vertically by amount baseline.

Parameters:
  • x – The independent variable, e.g. depth or time
  • y – The dependent variable, e.g. probability of measuring 1
  • weights – Optional weightings of each point to use when fitting.
  • param_guesses – initial guesses for the parameters
Returns:

a lmfit Model