general regression function to rks ridge