def rippe_parameters(matrix, positions, lengths=None, init=None, circ=False):
n, _ = matrix.shape<EOL>if lengths is None:<EOL><INDENT>lengths = np.abs(np.diff(positions))<EOL><DEDENT>measurements, bins = [], []<EOL>for i in range(n):<EOL><INDENT>for j in range(<NUM_LIT:1>, i):<EOL><INDENT>mean_length = (lengths[i] + lengths[j]) / <NUM_LIT><EOL>if positions[i] < positions[j]:<EOL><INDENT>d = (((positions[j] - positions[i] -<EOL>lengths[i]) + mean_length) /<EOL><NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>d = (((positions[i] - positions[j] -<EOL>lengths[j]) + mean_length) /<EOL><NUM_LIT>)<EOL><DEDENT>bins.append(np.abs(d))<EOL>measurements.append(matrix[i, j])<EOL><DEDENT><DEDENT>parameters = estimate_param_rippe(measurements, bins, init=init, circ=circ)<EOL>print(parameters)<EOL>return parameters[<NUM_LIT:0>]<EOL>
Estimate parameters from the model described in Rippe et al., 2001.