## Learning Time Series with R

June 27, 2013
By

by Joseph Rickert Late last Saturday afternoon I was reading in my usual spot at the Dana Street Coffee House in Mt. View. A stranger walking by my table noticed my copy of Madsen’s Time Series Analysis (sitting there untouched again) said he needed to learn something about time series and asked if I could recommend a book. He...

## Portfolio Optimization

June 27, 2013
By

Changing tracks, I want to now look at portfolio optimization. Although this is very different from developing trading strategies, it is useful to know how to construct minimum-variance portfolios and the like, if only for curiosity’s sake. Also, just a … Continue reading →

## Parameter Optimization for Strategy 2

June 27, 2013
By

Now, let’s try some parameter optimisation for the SMA strategy! There probably are functions out there on R which I can use to do this, but I figured it would take me as long to actually code it as it … Continue reading →

## Fun with Fremont Bridge Bicyclists

June 27, 2013
By

Given the title of this post and its proximity to the Solstice, you will be disappointed to know that I am not writing about naked bicyclists. I apologize for any false hope I may have instilled in you.On October 11th, 2012, the city of Seattle, WA beg...

## R Package Versioning

June 27, 2013
By

This should be what it feels like to bump the major version of your software: For me, the main reason for package versioning is to indicate the (slight or significant) differences among different versions of the same package, otherwise we can keep o...

## Analyses of the Best Undergraduate (US-based) Business Schools of 2013

June 27, 2013
By

Link to the code for the analysis program is given at the very end.I teach in a business school and am always fascinated by rankings published by different outlets. As much as one would like to think that they are meaningless, they seem to influence ho...

## Decluttering ordination plots part 3: ordipointlabel()

June 27, 2013
By

Previously in this series I looked at first the ordilabel() and then orditorp() functions in the vegan package as means to improve labelling in ordination plots. In this the third in the series I take a look at ordipointlabel().

## ?help! Instant R search on Rdocumentation.org

June 26, 2013
By

Last week, I was working on an educational R project when I needed to consult the help files of different R packages and functions online. After doing some Google searches, it appeared to me that finding an easy-to-use tool was not as simple as I had expected. The closest that I got, were the websites

## R snippets for vim-SnipMate

June 26, 2013
By

Vim is my editor of choice, reasonable so, whether it be for coding C++, LaTeX or even R. I’ve used RStudio, which even has a Vim-Mode, but I still prefer to use Vim. Vim has it’s own R plugin, namely Vim-R-plugin, but this post is about snippets. SnipMate is an awesome auto-completion plugin for Vim The post R...

## Strategy 2: Riding the SMA Curve

June 26, 2013
By

This is the least complicated trend strategy in existance. You buy and hold the security as long as the security price is above a XXX-Day Simple Moving Average (SMA), and you can short it if it is below the SMA … Continue reading →

## Strategy 1 Extended (Part 2)

June 26, 2013
By

We can extend our strategy and make it more profitable by incorporating short selling. Our annualized volatility will go up, but it will be interesting to see what happens to the annualized return. This is a very simple modification to … Continue reading →

## Strategy 1 Extended (Part 1)

June 26, 2013
By

Like I said in my previous post, there are two ways I could think of, off the top of my head, to implement a 2-day or 5-day extension to the previous strategy. One way would be just a simple extension … Continue reading →

## Trading Strategy 1: What goes up, goes up…

June 26, 2013
By

As I said earlier, my main task at my internship is to hunt for profitable strategies. As you can imagine, strategies can range from the exceedingly simple and easy to implement, to the crazily complex. Let’s start out with one … Continue reading →

## Looking out for volatility

June 26, 2013
By

Let’s do an easy experiment. Lets caluclate the 25-day rolling volatility of the S&P 500 from 2007 onwards. 1-Get the data: getSymbols(‘SPY’,from=’2007/01/01′) 2-Run the volatility function from the package TTR (comes along with quantmod): vol=volatility(SPY,n=25,N=252,calc=’close’) #n=25 means we want 25 … Continue reading →

## Using R: Two plots of principal component analysis

June 26, 2013
By

PCA is a very common method for exploration and reduction of high-dimensional data. It works by making linear combinations of the variables that are orthogonal, and is thus a way to change basis to better see patterns in data. You either do spectral decomposition of the correlation matrix or singular value decomposition of the data

## Technical(and not technical) strategy testing

June 25, 2013
By

I got "hooked" on OOP approach of R in particular reference classes. And after my last little project on option scenario analysis I reconstructed my messy technical strategy testing code.Now to begin I would like to reason why I have done this while there exists a nice "blotter" and "quantstrat" packages.First of all "quantstrat" is faster than blotter, which...

## Natural language processing tutorial

June 25, 2013
By

Introduction This will serve as an introduction to natural language processing. I adapted it from slides for a recent talk at Boston Python. We will go from tokenization to feature extraction to creating a model using a machine learning algorithm. The goal is to provide a reasonable baseline on top of which more complex natural language processing can be...

## My talk at Boston Python

June 25, 2013
By

I just gave a talk at Boston Python about natural language processing in general, and edX ease and discern in specific. You can find the presentation source here, and the web version of it here. There is a video of it here. Nelle Varoquaux and Micha...

## rClr: low level access to .NET from R

June 25, 2013
By

rClr is a package to access arbitrary .NET code seamlessly. The "CLR" acronym part of the package name stands for Common Language Runtime. C# and R being languages I regularly use, I have felt the need for better interoperability between these for a fe...

## Split violin plots

June 25, 2013
By

(This article was first published on Ecology in silico, and kindly contributed to R-bloggers) Violin plots are useful for comparing distributions. When data are grouped by a factor with two levels (e.g. males and females), you can split the violins in half to see the difference between groups. Consider a 2 x 2 factorial experiment: treatments A and B...

June 25, 2013
By

## A comprehensive guide to time series plotting in R

June 25, 2013
By

As R has evolved over the past 20 years its capabilities have improved in every area. The visual display of time series is no exception: as the folks from Timely Portfolio note that: Through both quiet iteration and significant revolutions, the volunteers of R have made analyzing and charting time series pleasant. R began with the basics, a simple...

## Getting started with R

June 25, 2013
By

I wanted to avoid advanced topics in this post and focus on some “blocking and tackling” with R in an effort to get novices started.  This is some of the basic code I found useful when I began using R just over 6 weeks ago. Reading in data from a .csv file is a breeze with this command. > data =...

## The Dream 8 Challenges

June 25, 2013
By

The 8th iteration of the DREAM Challenges are underway. DREAM is something like the Kaggle of computational biology with an open science bent. Participating teams apply machine learning and statistical modeling methods to biological problems, competing to achieve the best predictive accuracy. This year's three challenges focus on reverse engineering cancer, toxicology and the kinetics of...

## Three Ways to Run Bayesian Models in R

June 25, 2013
By

There are different ways of specifying and running Bayesian models from within R. Here I will compare three different methods, two that relies on an external program and one that only relies on R. I won’t go into much detail about the differences in syntax, the idea is more to give a gist about how the different modeling languages...

## Exploratory Data Analysis: 2 Ways of Plotting Empirical Cumulative Distribution Functions in R

$Exploratory Data Analysis: 2 Ways of Plotting Empirical Cumulative Distribution Functions in R$

Introduction Continuing my recent series on exploratory data analysis (EDA), and following up on the last post on the conceptual foundations of empirical cumulative distribution functions (CDFs), this post shows how to plot them in R.  (Previous posts in this series on EDA include descriptive statistics, box plots, kernel density estimation, and violin plots.) I

## Predicting spatial locations using point processes

June 25, 2013
By

I’ve uploaded a draft tutorial on some aspects of prediction using point processes. I wrote it using R-Markdown, so there’s bits of R code for readers to play with. It’s hosted on Rpubs, which turns out to be a great deal more convenient than WordPress for that sort of thing.

## -omics in 2013

June 24, 2013
By

Just how many (bad) -omics are there anyway? Let’s find out. 1. Get the raw data It would be nice if we could search PubMed for titles containing all -omics: However, we cannot since leading wildcards don’t work in PubMed search. So let’s just grab all articles from 2013: and save them in a format

## Visualising Crime Hotspots in England and Wales using {ggmap}

June 24, 2013
By

Two weeks ago, I was looking for ways to make pretty maps for my own research project. A quick search led me to some very informative blog posts by Kim Gilbert, David Smith and Max Marchi. Eventually, I Google'd the excellent crime weather map exa...

## Recent popular posts

Contact us if you wish to help support R-bloggers, and place your banner here.