Indeed, the objective function in OSR is the second moments, that is,

lambda *var(yt) + var(pit).

But my objective is

lambda* (yt - y*)^2 + (pit - pi*)^2.

Where y* is the target value of yt. So could you help tell me how I can write the code of this objective function?