Random number of switch points in regression

Thanks, I think I will have to use this method then.