Prediction with Nan and gaussianRandomWalk

I am working on a prediction functionality for time series data. I have seen suggested that appending NaN to the observed dataset and using a randomwalk function can be used to predict the missing NaN-values.
I am however having trouble understaning how this prediction is done. I tried Predicting/forecasting with this technique on a simple sine-signal. The result indicate that i need help… In advance, thank you!