Matlab versus R

User avatar
IAmEric
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by IAmEric »

Over in another [url=/Show%20Post.aspx?PostIDKey=86689]thread[/url], quantie said



[i]eric i would agree the only problem being that there is really no difference between learning matlab and R. Really there are great books on the S-language out there. And matlab makes you pay for every little tool box compared to R where everything is free as in beer.[/i]



I have never (even going back to the very first day) had to spend "several hours" to figure out any feature in Matlab. My experience with R, on the other hand was excrutiating. I spent many "several hour" periods trying to do mundane things like formatting a legend or something silly like that. The Help in Matlab is phenomenal. Even a complete newbie can get almost all of the functionality with minimal effort via the help pages.



It's been a while since I tried R, so the status of the "Help" (which was pretty much non-existent last time I tried) may have improved significantly, which would reduce the effectiveness of my argument somewhat. Nonetheless, for someone to spend "hours" trying to figure out something in R is just a totally foreign concept in the Matlab universe.



Then again, I know you (quantie) are the R expert. Once you obtain expert status in any language, it will appear to be simple. Just remember those early growing pains (I know you felt them!), which are pretty much not there for Matlab newbies who have minimal exposure to programming.



As far as adding packages in R versus Matlab. Matlab certainly does have toolboxes that they sell, but they are not necessary. I STILL haven't felt the need to purchase a toolbox. On the rare occasion when I do not feel like reinventing the wheel, I've never had difficulty finding an appropriate Matlab package available for free on the web either through Matlab central or google.



Eric
One day, in the midst of another one of his increasingly frequent homicidal fantasies, Croke noticed a new member had invaded his favorite forum. It was an obnoxious coed (or so he thought) who went by the nickname "Lilly". At first, all Croke could think about was strangling the life out of this giddy new member. Her insistent flirting with everyone was disgusting to Croke and he began a merciless vendetta against her.



He was sure that his prominent status would cause the other "regulars" to outcast the newcomer as he wished. On the contrary, everyone dug Lilly and even Croke's most vehement beratings fell on def ears. This infuriated Croke even more.
User avatar
quantie
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by quantie »

ok thanks for annointing me to expert status :)



But seriously the problem with R as you point out is that the help is not quite what you get in matlab. And when a beginner posts on r-help, you have a bunch of gruff email responses mostly RTFM and so you read this and then learn to ask the right questions!.



I have found that some investment in reading the three books by venables and ripley pays off well. I first spent some time with this book here when i was messing with matlab.



The future is going to be free software & R type software that is once they figure out a model for paying the contributors. Just take a look at the taskviews on CRAN here

the breadth of packages there is truly amazing!!.
Blistering Barnacles;Thundering Typhoons
User avatar
apine
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by apine »

one issue that i always had with open source was accountability. that is, if there is some problem with the software how is that addressed. also, if new features are desired, how is that addressed. one behavior of software people vs. end users is that on occasion the software people will feel that the end users "don't really know what they want." and, of course, the end users really do.



that said, i find that in practice, software vendors do not seem to take responsibility for their work or address new features that well. it may be that open source deals with this better de facto rather than as the theory would suggest.



i'm not a matlab user nor an R user, so i am not taking sides.



one other major issue is that for packages that analyze data it seems that the package is not often the problem. my biggest dread is dealing with the data. dates that don't match up, missing data, incorrect data, etc. we need some standardization for that.
Too many people make decisions based on outcomes rather than process. -- Paul DePodesta
User avatar
omd
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by omd »

"my biggest dread is dealing with the data. dates that don't match up, missing data, incorrect data, etc. we need some standardization for that."



Undoubtedly, the least fun part of quant finance/trading Puke



I have MatLab finally, but so far, I have stuck to C++ because I can move really fast with that these days.  When we get a break in the action, I am going to want to play around with MatLab more.  It certainly seems like amazing software.  We have two toolboxes - optimization and stats - this is what our algorithmic options traders use, so I figured it was good enough for me.
yo
User avatar
jslade
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by jslade »

I am Eric wrote [i]"My experience with R, on the other hand was excrutiating. I spent many "several hour" periods trying to do mundane things like formatting a legend or something silly like that. "[/i]



Even though I am an R advocate, I have to admit, my experience was similar. R is a different kind of language from what most of us are used to. Matlab fits the way people generally think in computerese.



The help tabs have improved over the years; installing JGR on a windows machine will help your overall experience a lot (or, use a Mac). They're still not as high quality as Matlab's are. Best idea is to invest in some R books and some painful days, if you really want to learn.



Why learn? There is lots you can do in R that doesn't exist in Matlab, and probably will never exist. Most machine learning stuff seems to happen in R. Lots of the published research in quant stuff has R code associated with it (examples: the wavelets and high frequency finance books by Gencay and Olsen & associates, Bouchaud's stuff, etc). R lacks Matlab's IDE polish, but even the UI is damn good for free stuff, and the innards are top notch.



The main downside to R is the lack of "compiler," to distribute code to users. Not that Matlab has a real compiler any more, but you can bundle up Matlab code with an encapsulated interpretor/java thingee and give it to users. The only real way to do that with R code is through a thin client, and thin clients suck.
"Alles hat ein ende, nun die wurst hat zwei."
User avatar
tristanreid
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by tristanreid »

Matlab also has a number of other methods of distribution these days, there's an add-on compiler that costs Dollar Bill , and other's for distributing as COM, .NET, or Excel add-in (strong microsoft focus there).



-t.
If you can make computers as smart as humans you will have invented a machine that can sing the words to the Flintstones tune but will forget to pay the phone bill.
User avatar
tristanreid
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by tristanreid »

[i][b]jslade:[/b] Best idea is to invest in [b]some R books[/b] and some painful days, if you really want to learn.[/i]



Can you recommend any in particular? I'm not looking to do anything in R in the near future, but it might be nice to have a good resource on hand if it comes up.



thanks,



-t.
If you can make computers as smart as humans you will have invented a machine that can sing the words to the Flintstones tune but will forget to pay the phone bill.
User avatar
jslade
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by jslade »

[i]"Can you recommend any in particular? "[/i]



My favorite is Venables & Ripley, "modern applied statistics with S." That + the 2 "cheat sheets" and you're on your way.

Cheat sheets:

www.rpad.org/Rpad/R-refcard.pdf

cran.r-project.org/doc/contrib/refcard.pdf



-jslade
"Alles hat ein ende, nun die wurst hat zwei."
User avatar
tristanreid
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by tristanreid »

In another thread, a question came up of R vs. Matlab for large matrix manipilations.  I don't know enough of R to have a strong opinion.  This article compares the two (and others):



http://www.scientificweb.com/ncrunch/ncrunch4.pdf



See page 25 for speed comparison between R and Matlab.  For a few 'external data' operations (reading from IO or DB) Matlab lags, but in matrix operations, it appears to be handily faster than R.



On the other hand, these are older versions (circa 2004), and every computer benchmark deserves skepticism.



-t.
If you can make computers as smart as humans you will have invented a machine that can sing the words to the Flintstones tune but will forget to pay the phone bill.
User avatar
jslade
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab versus R

Post by jslade »

tristanreid:



I'd say over all, that comparison makes them out to be more or less the same (though splus != R; they probably differ in speed as much as splus and Matlab, as they have rather different intestines, even if the language looks the same). I'm surprised scilab came out so well; it wasn't that good a few years prior. Also, matlab v7.x is about 2x slower on everything than Matlab 6.5, in my experience. Seems like they've got some extra event loop stuff going on.
"Alles hat ein ende, nun die wurst hat zwei."
Post Reply