R Language

Were stock returns really better in 2007 than 2008?

November 22, 2010 | Pat

We know that the S&P 500 was up a little in 2007 and down a lot in 2008.  So on the surface the question seems really stupid.  But randomness played a part.  Let’s have a go at deciding how much of a part. Figure 1: Comparison of 2007 and 2008 for the S&P 500. ... [Read more...]

R is a name you need to know

November 11, 2010 | Pat

As if that is news to some of you. Forbes has a Mean Business blog post by Steve McNally titled “Names You Need to Know in 2011: R Data Analysis Software”. The post includes several links to why R is wonderful. It also includes a pretty — but seemingly useless — statistical graph.  ...
[Read more...]

The ARORA guessing game

November 9, 2010 | Pat

The game ARORA (A random or real array) is a website that gives you two time series at a time. Your job is to guess which series is real market data and which is permuted data.  It’s fun — try it. With some practice you will probably be able to ... [Read more...]

How to Start Using (pgf)Sweave in LyX in One Minute

October 30, 2010 | Yihui Xie

regor Gorjanc published an interesting article “Using Sweave with LyX” in R News in 2008, which (I believe) makes it much easier to use Sweave. I use command-line tools a lot every day, but I am still “GUI-addicted”. (I don’t want to comment more about Microsoft Word here.) LyX is ... [Read more...]

Ideas for World Statistics Day

October 19, 2010 | Pat

World Statistics Day is 2010 October 20.  If you work with data (or you should), then you are a statistician and this is a day for you. Try the Monte Hall problem on your mother. Start reading Bad Science.  I mean the book, but here’s the blog. Take a step towards ...
[Read more...]

American TV does cointegration

October 18, 2010 | Pat

Fringe provides an excellent example of cointegration.  This is a television show in which there are two adjacent universes.  The universes are almost alike but not exactly. Now, everyone knows that history is chaotic.  If a butterfly does an extra flap of its wings, then that difference spreads out to ...
[Read more...]

On the Gory Loops in R

October 17, 2010 | Yihui Xie

his blog post is mainly for Stat 579 students on the homework for week 7, since I received too many “gory” loops in the homework submissions and I think it would help a bit to write my thoughts on R loops for beginners. The immortal motto for newbies in programming is: If ... [Read more...]

A tale of two returns

October 4, 2010 | Pat

It was the best of times, it was the worst of times. As you may have guessed, this is a mashup of a novel by Charles Dickens and an explanation of financial returns. The key plot element of A Tale of Two Cities is that there are two men, Charles ...
[Read more...]

Physical economy v social economy

September 17, 2010 | Pat

There’s a hole in the bucket of traditional economics. Homo socialus seems to be on the rise, and homo economicus is getting harder to find. Vulcanism has become evident in the R community over the last several days.  One of the visible eruptions has been over money.  This resulted ...
[Read more...]

SyntaxHighlighter Brush for the R Language

September 11, 2010 | Yihui Xie

al Galili requested in the R-help mailing list for a SyntaxHighlighter brush for the R language, so that WordPress users can highlight their R code easily. I promised to contribute a few minutes on this task, and here is the result: /** * Author: Yihui Xie * URL: http://yihui.name/en/2010/09/syntaxhighlighter-brush-for-the-r-language * ... [Read more...]

What the hell is a variance matrix?

August 25, 2010 | Pat

When I first came to finance, I kept hearing about “risk models”. I wondered, “What the hell is a risk model?” Of course, I didn’t say this out loud — that would have given the game away.  My wife has strict instructions that she is to be the only one ...
[Read more...]

Auto-completion in Notepad++ for R Script

August 14, 2010 | Yihui Xie

Auto-completion is fancy in a text editor. Notepad++ does not support auto-completion for the R language, so I spent a couple of hours on creating such an XML file to support R: Put it under ‘plugins/APIs‘ in the installation directory of Notepad++ (you can see several other XML files ... [Read more...]

R is an Epic Fail?

April 15, 2010 | Yihui Xie

I came across this blog post just now: The Next Big Thing, and of course these words caught my attention: [...] However, for me personally and for most users, both individual and organizational, the much greater cost of software is the time it takes to install it, maintain it, learn it ... [Read more...]

R package Blotter

April 6, 2010 | kafka

How many times have you been disappointed by nice trading system, because neither trading cost or slippage or bid/ask spread were included into back-test results? Did you find difficult to back-test a portfolio in R or many portfolios with different stocks? Blotter package is supposed to solve these problems. ... [Read more...]

Predicting April month return

March 31, 2010 | kafka

Bespoke blogged about average monthly returns of the DJI and emphasized April. Before jumping on that information, let’s check some weak points. In that post, only average returns are presented. We need at least extreme points (min;max) and confidence ranges. Second problem – the normal market have upward trend ... [Read more...]

Looking for Software Paths in Windows Registry

March 28, 2010 | Yihui Xie

hen we want to call external programs in R under Windows, we often need to know the paths of these programs. For instance, we may want to know where ImageMagick is installed, as we need the convert (convert.exe) utility to convert images to other formats, or where OpenBUGS is ... [Read more...]

Returns on Easter week and one week after

March 21, 2010 | kafka

Inspired by CXO group report, I did a rerun of the same strategy on my data. Easter’s dates can be find at wikipedia. Overall, my results are similar to CXO group’s results. In the graph below, I plotted daily returns on Easter week (Monday to Thursday) from 1982 to 2009. ... [Read more...]
1 7 8 9 10

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)