Comparative Analysis of R and Python For Mathematical Programming
Comparative Analysis of R and Python For Mathematical Programming
programming
R and python are the frontrunners these days for the mathematical programming. R is
favored for the statistical and data analysis and stands out as a direct and a strong opponent
for SAS. But in past few years python has equipped itself with powerful tools for data
analysis and has been giving competition to R especially for small and mid-sized problems.
Python and R both are powerful for data analysis and come with a lot of packages for solving
data problems.
Python is an open source scripting language which has grown over time. It has libraries
such as scipy, numpy,matplotlib ,pandas for the mathematical programming and data
analysis for the structured data.
R
Advantages of R
R is a mature solution as compared to python .
Vast libraries and many APIs for a single problem.
Professional Support is available in the form of Revo R in case we go ahead and purchase
license. Even if you dont purchase license R community is strong.
Quick results.
Challenges with R
R involves a steep learning curve.
Not an object oriented language (Not very relevant for data analysis)
Low level programming language, a simple procedure takes a lot of code writing.
Threading is not available.
Data is copied via call by value than call by reference , so it has some memory cost
associated with it.
Comparison Matrix
There are many attributes on the basis of which the two can be compared. The real
bottlenecks for any mathematical, statistical package is the implementation of the models
and mathematical functions which are time consuming and increase the space and time
complexity of the algorithm in general.
For basic operations with data R and python offer similar results but R offers a long range of
stats library
For data analysis from the machine learning perspective python is generally recommended
while the data analysis from the statistical purposes R is highly used.
Development speed: Python > R
Currently R is the real competitor of SAS but python has a promising future.
Parameter
Availability/Cost
Python
Open Source
Ease of Learning
Community
Documentation
Coherent
Typical Uses
Major disadvantage
Nonlinear constrained
optimization support*
Engineering
Not very mature
Scipy.optimize()
Uses Newton
Conjugate gradient
algorithm
License
BSD
Graphical capabilities
R
Open Source(Commercial
version provided by
Revolution analytics)
Very steep learning curve
Can be scaled using Hadoop,
not an in memory limited
solution any more
Best in class graphical
representations available
Very strong community and
prompt solutions available
A lot of people develop their
own libraries, so
documentation is not in
depth for few of them.
Finance and Statistics
Very steep learning curve
Optimx(),nloptr(),optim()etc
Uses Newton conjugate
gradient algorithm (Interior
point algo is there but used
in quadratic and cone
programming packages)
GPL , LGPL, BSD , MIT
licenses associated with
various packages of R