linear interpolation of nans in vector - from gru johan repo
basic polynomial detrend - from gru johan repo