R scripts for stock prediction