• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

R Programming language?

I love R. I find it easier than Matlab (the syntax is more similar to c++ and it is easier to define and run functions) but not less powerful.

The downside is R is really slow...I have coded monte carlo simulations in c++ that take seconds that take R minutes.
 
The downside is R is really slow...I have coded monte carlo simulations in c++ that take seconds that take R minutes.

This could not be more true. I've tried experimenting with the parallel processing packages for R but to no success. I do find R to be perfect for investigating data though. Beautiful plots and so many statistical tests accessible in seconds with different packages!
 
This could not be more true. I've tried experimenting with the parallel processing packages for R but to no success.

I have used R extensively and I have never had a problem. I really don't know what you are doing but, in my experience, R is never the problem.
 
To me the downside of R is the plotting - not interactive, so it's much harder to explore the data naturally.

As far as speed, vectorize the code.
 
The downside is R is really slow...I have coded monte carlo simulations in c++ that take seconds that take R minutes.

R and C++ have totally different goals. I don't disagree that R could be slower than C++ but for numerical algorithms, you can usually make R run as fast as C++... and you can usually rewrite the slow pieces of the R programs in C or C++.
 
To me the downside of R is the plotting - not interactive, so it's much harder to explore the data naturally.
This is definitely a problem. There are some packages trying to solve this but the degree of success varies.
 
This is definitely a problem. There are some packages trying to solve this but the degree of success varies.
What I might end up doing is feeding R through Python and matplotlib via RPy.

I've tried some of those packages and overall it's still pretty painful to get what you want, although there are some good parts.
 
What I might end up doing is feeding R through Python and matplotlib via RPy.

I've tried some of those packages and overall it's still pretty painful to get what you want, although there are some good parts.

I have used RPy and RPy2. They work very well. I have a Django portfolio optimization tool that uses Rmetrics for the heavy lifting.

I usually end up writing a lot of python code and calling R code when I know the solution in R right away and don't want to dig through the python libraries.
 
I love R. I find it easier than Matlab (the syntax is more similar to c++ and it is easier to define and run functions) but not less powerful.

The downside is R is really slow...I have coded monte carlo simulations in c++ that take seconds that take R minutes.

I've run the exact same time series functions on the same data in R and Matlab. It took <1 second in Matlab and 30 seconds in R.
 
I used mostly RPy2. Don't recall exactly why I decided on that one and not RPy.
 
To me the downside of R is the plotting - not interactive, so it's much harder to explore the data naturally.

As far as speed, vectorize the code.

For interactive plotting I use Manipulate via RStudio. I have found it to be quite grand. Vectorization only goes so far unfortunately. If I recall correctly, even the apply functions are actually coded as loops and have similar execution speeds.

I really don't know what you are doing but, in my experience, R is never the problem.

What I am doing: Numerical algorithms and Monte Carlo simulations
R's problem: Speed (Slow)

I don't disagree that R could be slower than C++ but for numerical algorithms, you can usually make R run as fast as C++... and you can usually rewrite the slow pieces of the R programs in C or C++.

Now we are getting somewhere ;)
 
I've been using R for around 5 years now, and I love it to bits. Aside from the access to the latest research in statistics and machine learning, you can call your C, C++ and Fortran code from R, so speed is not really a problem (the only one real gripe I have is the generally terse documentation). Also, if you're planning on doing really intense computation that can be parallelized, you should capitalize on R+CUDA.
 
Fact
R is preferred in some of the top Asset MGT firms compared to C++.
Fact
Not all quantitative analysts know C++
Fact
If you know C++ and too many languages, your colleagues may see you as the "data cleaner". Now your not in finance, your in operations. Be smart about what you focus on.

Here is what may determine your career path
If you can be intellectual with C++ and other computing languages but cannot calculate the yield (WITHIN 3 SECONDS) of a zero that will mature in one year trading at 80 and par 100, maybe operations is a better path of travel for you.
 
R is great for statistical programming and analysis. In my undergrad, we used it a lot because some of our faculty members is on the R core development team. I think it has it's ups and downs. But It's free, and that's always nice.
 
I've run the exact same time series functions on the same data in R and Matlab. It took <1 second in Matlab and 30 seconds in R.

I'm working on a project, where I have to recode / impute categorical variables. On a 2046 x 11 test dataset, R took somewhere between 15 - 30 secs on average. I recoded that part in Bash and it gets the same job done in about a second. That said, R does have its strong points : easy EDA (exploratory data analysis) and plotting, very mature stats and machine learning packages, and it integrates with other major languages...
 
I'm working on a project, where I have to recode / impute categorical variables. On a 2046 x 11 test dataset, R took somewhere between 15 - 30 secs on average. I recoded that part in Bash and it gets the same job done in about a second. That said, R does have its strong points : easy EDA (exploratory data analysis) and plotting, very mature stats and machine learning packages, and it integrates with other major languages...
if you can code something in bash that was written in R, it means that R was used for the wrong reasons. R strengths are far away from what bash can do.
 
Back
Top