def estimate_cp(ts, method="<STR_LIT>", Q=<NUM_LIT:1>, penalty_value=<NUM_LIT>):
"""<STR_LIT>"""<EOL>robjects.r("<STR_LIT>")<EOL>method_map = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>}<EOL>mt = robjects.FloatVector(ts)<EOL>robjects.globalenv["<STR_LIT>"] = mt<EOL>if method == "<STR_LIT>":<EOL><INDENT>cmd = method_map[method].format("<STR_LIT>", Q, penalty_value)<EOL><DEDENT>else:<EOL><INDENT>cmd = method_map[method].format("<STR_LIT>")<EOL><DEDENT>robjects.globalenv["<STR_LIT>"] = robjects.r(cmd)<EOL>ecp = robjects.r("<STR_LIT>")<EOL>return ecp<EOL>
Estimate changepoints in a time series by using R.