Tag Archives: youtube

My Youtube video Demo of my SeekingAlpha com technical indicator with RSI, MACD, Bollinger Band chart script in R with C# Gmail Sender

My Youtube video Demo of my SeekingAlpha com technical indicator with RSI, MACD, Bollinger Band chart script in R with C# Gmail Sender

Learn more what I do with this or get access to it now by going here.

[youtube_sc url=”http://www.youtube.com/watch?v=mSp9l40aNgg”]

R and Java bridge demo with Youtube posted with Eclispe Juno IDE project consisting of Java source code

 

R and Java bridge demo with Youtube posted with Eclispe Juno IDE project consisting of Java source code

Hey

I have now posted an extended demo video of how to bridge Java and R together with this neat open source package.

Get details and video here:

quantlabs.net/blog/2012/08/using-rcaller-to-bridge-r-and-java-together-easily-and-flawlessly/

Get the Eclipse project with Java source code here:

 

Here is a Youtube Video Series on How to Write Fast R Code

Here is a Youtube Video Series on How to Write Fast R Code

One of my Quant Finance Meetup members, Alon, has put up two videos in a series about speeding up the execution of R. It was a presentation he did a few months ago to the group. Thanks to him for these videos and presenting.

This is an instructional video on increasing the speed with which R code is executing. It is mostly related to tricks in the R syntax that substantially decrease the time it takes for R to execute code.  There are 12 different tricks in the tutorial to increasing the efficiency of your code. Specific replicable examples are given so that you can try them at home. The neatest thing about these techniques is that they do not require any additional tools beyond the standard R Build. I have decreased the time it takes for a complex simulation from 15 minutes to less than 2 without using any compiled languages!!!

[youtube_sc url=”http://www.youtube.com/watch?v=d6cDjY6lfgI” playlist=”r fast code”]

[youtube_sc url=”http://www.youtube.com/watch?v=CDvf5Wzw584″ playlist=”r fast code part 2″]

 

Here is a Youtube video on how to use R to access MYSQL through RMySQL R package

Here is a Youtube video on how to use R to access MYSQL through RMySQL R package

This might be one of those extra unneeded videos you can find on Youtube but surprise, there were none. After running my survey of which database (commercial, open source RDMS or NOSQL) R users run, it struck me that nearly half use MYSQL followed by PostgreSQL.

I always had concerns of MYSQL with scaling and redundancy for my large data I anticipate my models and simulations will need. I demoed everything from Cassandra, Hadoop, Redis, MongolDB, etc. I found many were good but I found Redis to be the best one that fit my needs. As a result, I though  I was set until…

I came across an open source trading platform done in C++ called Trading Shim. This was a rare find as it met all my needs including Interactive Brokers but used MYSQL out of box. The database schema was big as well. I tried debugging and configuring which is still not complete but I am getting closer.

After seeing the results of my survey, I through why not stick with MYSQL for now as it can be fast enough. Hey, Yahoo Finance uses it for their backend so it cannot be that bad right. I just understand you would go through some heavy configuring to do something like sharding. This would not be as easy as in something like Redis. Anyhow, also MYSQL has proven to be the most popular database as well so it might be wise to get more comfortable with something that is widely used.

As for this Trading Shim, it makes my life so much easier without needing to recode anything so I just need to have my R algorithms access the MYSQL data. This was a much more sensible option at least this point to minimize the coding and debugging cycles.

So …enough typing, I have this video posted to show how easy it to have R access MYSQL. As said, this appears to only work in a Linux environment due to the RMySQL requires RCpp which only works with GCC, not Visual Studio for Windows. Sorry, I don’t make the rules. You could install MINGW for Windows and GCC but why would you want to go through the pain of that?

[youtube_sc url=”http://www.youtube.com/watch?v=LvCFaTln_3g” playlist=”how to have R access MYSQL through RMySQL R package”]

Youtube video: Proper steps to integrate MongoDB NOSQL database with R on Ubuntu Linux with RStudio

Youtube video: Proper steps to integrate MongoDB NOSQL database with R on Ubuntu Linux with RStudio

Why NOSQL?

When comparing other RDMS including Oracle, MySQL or DB/2 against NOSQL, I was one of those old geezers who thought they were another ‘go fast nowhere’ technology trend.

Boy, was I wrong! I looked at all the options including HBase/Hadoop, Cassandra, Redis, and MongoDB. I found Hbase and Hadoop were difficult to install. The R packages for these were useless as there were few installation documents. Cassandra was easy but the the client support for R either didn’t exist or didn’t work with the RCassandra package. Redis looked awesome and is still one of the best for R thanks to the doRedis R package. The Java examples to shard looked promising too.

Then I revisited everything and came across MongoDB. It seems to have all the advantages of Cassandra and Redis with decent R package support.

NOSQL options and R

After looking at all the options, my recommended NOSQL databases is Redis or MongoDB. It was easy to install Redis but tricky with MongoDB. My recommendation is to install MongoDB with a clean current Ubuntu Linux Desktop version. All you need to do is type the following on the command line:

‘apt-get install mongo’

… and you’re ready to go. It takes care of all the permissions, users, etc. It was so easy that I could have saved a day’s work without going through the hoops I did. A lesson learned, and the time I lost is time you can save!

MongoDB install obstacles and tricks

Here are some current tricks to save you even more time:

Install Open JDK 6 not 7 as it will mess up the RJava install with R

If this happens, keep an eye out for a message that says something to the effect of checking your Linux Java environment. It will say you need to run as root, R CMD java or something similar. This message would be appear in your R console during the RJava package install. My problem came to Java 7 versus 6 which resolved it.

Create your MongoDB mydb data with:

http://www.mongodb.org/display/DOCS/Tutorial
http://pseudofish.com/blog/2011/05/25/analysis-of-data-with-mongodb-and-r/

Once installed, you should be able to do the following within your R shell or RStudio:
for RMongo:

> library(“RMongo”)

Loading required package: RUnit

> mongo <- mongoDbConnect(“mydb”)
> dbShowCollections(mongo)
[1] “system.indexes” “things”
> results <- dbGetQuery(mongo, “nutrient_metadatas”, “{}”, 0, 2)
> results <- dbGetQuery(mongo, “things”, “{}”, 0, 2)
> names(results)
[1] “X_id” “name”
> dbDisconnect(mongo)

[youtube_sc url=”http://www.youtube.com/watch?v=DbhdKBx-lK0″ playlist=”How to, Integrate, MongoDB ,NOSQL, database ,R , Ubuntu, Linux, RStudio ” title=”How%20to%20Integrate%20MongoDB%20NOSQL%20database%20with%20R%20on%20Ubuntu%20Linux%20with%20RStudio%20″]

My Youtube video using free R-Studio for newbies and installing free R packages from CRAN or R-Forge

My Youtube video using free R-Studio for newbies and installing free R packages from CRAN or R-Forge

I have just posted a new video on the amazing combination of all these tools.

Why R-Studio?

There is no difference if you use are using Eclipse or Netbeans as an integrated development environment, I love this free tool R-Studio which should be added to your arsenal for any model prototyping or development. It can be used on any major operating system platform including Mac OSX, Linux, or Windows. It also has a server edition you can load up on a remote server for developing through a browser session including an Apple Ipad. Pretty neat compared to something like Matlab Mobile. This is the primary reason why I switched from Matlab to R.

The confusing difference between CRAN and R-Forge

As a newbie, I could not find the difference with these R package repositories. As a discovery on Stackexchange.com, it was simply explained CRAN contains your milestones releases of R packages. This basically means they are more stable and could be major releases as well. As some R packages have many developers to the package, you could get changes every few hours which may make the package unstable if there was a potentially bad change. As a result, the package administrator may release the milestone into CRAN

R-Studio and CRAN

As you will find in this video, I would feel more comfortable to stick with CRAN and so does R-Studio. This video shows you how ridiculously easy it is to install an R package from CRAN. As I will start depending on these R packages for my production environment,   I would have no choice but do this. I am a sure a large bank or hedge fund would feel these same way. You can still manually install R packages from R-Forge as well.

A Thanks Goes To….

Thanks to this R community for developing these pretty amazing tools and packages. Best part is the documentation is definitely adequate to get me started fairly quickly with confidence as well. I am sure they spend a pretty huge amount of selfless time to get these tools to the point where they are.

[youtube_sc url=”http://www.youtube.com/watch?v=TSxS0x4PLPg” playlist=”r, r-studio, cran, r-forge” title=”Using%20free%20R-Studio%20for%20newbies%20and%20installing%20free%20R%20packages%20from%20CRAN%20or%20R-Forge”]

 

 

Youtube video on using RCaller R package to call R from within Java application

Youtube video on using RCaller R package to call R from within Java application

This seems to work o from within a Linux virtual machine:

http://www.mhsatman.com/rcaller.php

http://stdioe.blogspot.ca/2011/07/rcaller-20-calling-r-from-java.html

Ensure to use RCaller 2..7 JAR for the above example to work.

http://stdioe.blogspot.ca/2011/07/rcaller-20-calling-r-from-java.html

[youtube_sc url=”http://www.youtube.com/watch?v=fHt0cq-6BvM” playlist=”r java”]