I am learning a code that uses CUSUM to detect changes. The code uses log-likelihood function:
logp = stepsize*basesd/variance * (data[k] - mean - stepsize*basesd/2.) (instantaneous log-likelihood for current sample assuming local baseline has jumped in the positive direction)
logn = -stepsize*basesd/variance * (data[k] - mean + stepsize*basesd/2.) (instantaneous log-likelihood for current sample assuming local baseline has jumped in the negative direction)
May I know from where i can learn this function whose formula is implemented that way or in a similar manner?