There are two very useful books for statistical and machine learning. One is The Elements of Statistical Learning: Data Mining, Inference, and Prediction, and the other is An Introduction to Statistical Learning with Applications in R . You can download the PDF versions of the books from the authors’ websites as well as the R codes used in the books.
Usually, I use MATLAB as a program tool to fit various models. MATLAB is usually faster than some of the computation tools. Its plot functions can also produce better graphs. For statistical analysis, MATLAB does not have many packages compared with R. A very similar software, called Scilab, has been developed, which is free software and has many built-in functions equivalent to the functions in MATLAB. When writing codes for Markov Chain Monte Carlo (MCMC) algorithms, both MATLAB and R are slow. For this reason, I write C/C++ codes using Code:Blocks as an IDE. Code:Blocks is a free integrated development environment for C, C++ and FORTRAN. As there are no efficient random number generators inside C and C++, I use Numerical Recipes, which provides not only C++ version but also versions for C, FORTRAN 77 and 90. You can call Numerical Recipes from within MATLAB®.