This question already has an answer here:

So I'm a budding quant, but came from an Economics background so what I learned first was R and, of course, have fallen in love ever since. However, I recently started doing research on why Python seems to be more valued in the finance industry, and based on many stack exchange questions (which I provide for context: here, here, and a reddit thread here), determined that, essentially, Python has two advantages:

  • more robust integration with other languages and tools (C, VBA, etc.)
  • bit faster when it comes to overall statistical analysis

However, R also has its clear Pros, which seem to be

  • superior visual representation of data (ggplot2)
  • access to cutting edge statistical and numerical methods

What I am interested in is the latter; however, I can't find too much research on what specific analysis R can do that Python can't. Would the more advanced statisticians and analysts here weigh in on this? I know Python has access to Tensorflow for deep learning and an advantage there, but are there any non-parametric analyses or non-linear models that Python won't have access to for the foreseeable future?


marked as duplicate by S. Kolassa - Reinstate Monica, Tim Nov 2 '17 at 8:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ Note that you can use both in RStudio. Also, R has a package for using Tensorflow (or Keras) from within R. I don't think there are many things R does that python can't do, but rather many existing packages for highly specific algorithms that aren't available in python. For example, need L1-regularized estimation while also incorporating random effects? Check out MMS or glmmLasso. Need to explore a dataset but it consists of repeated measures? Try MFA in FactoMineR and the ggplot addition factoextra for a quick solution. $\endgroup$ – Frans Rodenburg Nov 2 '17 at 6:46

While it was not the cutting edge, but rather a must have standard, my Python coworker and I (R DS) tried to find a function that solves a regression model using OLS. Neither in numpy nor in statsmodels could we find this. It can cause confusion when one needs to derive significance and SE for coefficients and a linear combination. It felt strange to not being able to find this tool as a statistical tool.

The R stats has lots of tools some of which may be lacking in Python libraries, but I am not ready to enumerate all that is missing.

Look at glmnet for R (it is also available in Python per @seanv507 suggestion): a generalized regularized regression, incorporating Lasso, Ridge, and ElsasticNet, solved by warm-up using modern gradient descent methods; published in circa 2000s to consider it a cutting edge algorithm.

  • 1
    $\begingroup$ glmnet is also available in python (don't know if all features) $\endgroup$ – seanv507 Nov 2 '17 at 7:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.