Veterinary Epidemiologic Research: Linear Regression Part 2 – Checking assumptions

March 6, 2013
By
Veterinary Epidemiologic Research: Linear Regression Part 2 – Checking assumptions

We continue on the linear regression chapter the book Veterinary Epidemiologic Research. Using same data as last post and running example 14.12: Now we can create some plots to assess the major assumptions of linear regression. First, let’s have a look at homoscedasticity, or constant variance of residuals. You can run a statistical test, the

Read more »

Stan 1.2.0 and RStan 1.2.0

March 6, 2013
By
Stan 1.2.0 and RStan 1.2.0

Stan 1.2.0 and RStan 1.2.0 are now available for download. See: http://mc-stan.org/ Here are the highlights. Full Mass Matrix Estimation during Warmup Yuanjun Gao, a first-year grad student here at Columbia (!), built a regularized mass-matrix estimator. This helps for posteriors with high correlation among parameters and varying scales. We’re still testing this ourselves, so The post Stan...

Read more »

Let’s Do Some Hierarchical Bayes Choice Modeling in R!

March 6, 2013
By
Let’s Do Some Hierarchical Bayes Choice Modeling in R!

It can be difficult to work your way through hierarchical Bayes choice modeling.  There is just too much new to learn.  If nothing else, one gets lost in all ways that choice data can be collected and analyzed.  Then there is all this ou...

Read more »

Lambda.r 1.1.1 released (and introducing the EMPTY keyword)

March 6, 2013
By
Lambda.r 1.1.1 released (and introducing the EMPTY keyword)

I’m pleased to announce that lambda.r 1.1.1 is now available on CRAN. This release is mostly a bug fix release, …Continue reading »

Read more »

A volatility filter using historical vol

March 6, 2013
By
A volatility filter using historical vol

We have been looking at a way to improve risk adjusted returns by using a volatility filter. Although we could use VIX or equivalent, it turns out that historical volatility will work just as well, if not a little better.You can see part 1 here Digging into the VIX, and part 2 here What can we use...

Read more »

Barycentric interpolation: fast interpolation on arbitrary grids

March 6, 2013
By
Barycentric interpolation: fast interpolation on arbitrary grids

Barycentric interpolation generalises linear interpolation to arbitrary dimensions. It is very fast although suboptimal if the function is smooth. You might now it as algorithm 21.7.1 in Numerical Recipes (Two-dimensional Interpolation on an Irregular Grid). Using package geometry it can be implemented in a few lines of code in R. Here’s a quick explanation of what

Read more »

Exporting plain, lattice, or ggplot graphics

March 6, 2013
By
Exporting plain, lattice, or ggplot graphics

A blend between a basic scatterplot, lattice scatterplot and a ggplot In a recent post I compared the Cairo packages with the base package for exporting graphs. Matt Neilson was kind enough to share in...

Read more »

Times per second benchmark

March 5, 2013
By

In GNU R the simplest way to measure execution time of a piece code is to use system.time. However, sometimes I want to find out how many times some function can be executed in one second. This is especially useful when we want to compare function...

Read more »

Le Monde puzzle [#810]

March 5, 2013
By
Le Monde puzzle [#810]

The current puzzle is as follows: Take a board with seven holes and seeds. The game starts with one player putting the seeds on the holes as he or she wishes. The other player picks a seed wherever. Then, alternatively, each player picks a seed in a hole contiguous to the previous one. The loser

Read more »

Predicted correlations and portfolio optimization

March 5, 2013
By
Predicted correlations and portfolio optimization

What effect do predicted correlations have when optimizing trades? Background A concern about optimization that is not one of “The top 7 portfolio optimization problems” is that correlations spike during a crisis which is when you most want optimization to work. This post looks at a small piece of that question.  It wonders if increasing predicted … Continue reading...

Read more »

Easily plotting grouped bars with ggplot #rstats

March 5, 2013
By
Easily plotting grouped bars with ggplot #rstats

Summary This tutorial shows how to create diagrams with grouped bar charts or dot plots with ggplot. The groups can also be displayed as facet grids. Importing the data from SPSS All following examples are based on an imported SPSS … Weiterlesen →

Read more »

Load Balanced Parallelization with snowfall

March 5, 2013
By
Load Balanced Parallelization with snowfall

For some reason, I didn't notice a few months ago the best way to perform a parallelized version of Lapply with package snowfall. We implemented the parallel version of function lapply with the function sfLapply, in the development of our pipeline p...

Read more »

Updating R from R (on Windows) – using the {installr} package

March 5, 2013
By

Upgrading R on Windows is not easy. While the R FAQ offer guidelines, some users may prefer to simply run a command in order to upgrade their R to the latest version. That is what the new {installr} package is …Read more »

Read more »

Create an R package from a single R file with roxyPackage

March 5, 2013
By
Create an R package from a single R file with roxyPackage

Documenting code can be a bit of a pain. Yet, the older (and wiser?) I get, the more I realise how important it is. When I was younger I said 'documentation is for people without talent'. Well, I am clearly loosing my talent, as I sometimes struggle to understand what I programmed years ago. Thus, anything that soothes the...

Read more »

Visualizing neural networks from the nnet package

March 4, 2013
By
Visualizing neural networks from the nnet package

Neural networks have received a lot of attention for their abilities to ‘learn’ relationships among variables. They represent an innovative technique for model fitting that doesn’t rely on conventional assumptions necessary for standard models and they can also quite effectively handle multivariate response data. A neural network model is very similar to a non-linear regression

Read more »

Cluster Risk Parity back-test

March 4, 2013
By
Cluster Risk Parity back-test

In the Cluster Portfolio Allocation post, I have outlined the 3 steps to construct Cluster Risk Parity portfolio. At each rebalancing period: Create Clusters Allocate funds within each Cluster using Risk Parity Allocate funds across all Clusters using Risk Parity I created a helper function distribute.weights() function in strategy.r at github to automate these steps.

Read more »

2013 World Universities Ranking

March 4, 2013
By
2013 World Universities Ranking

The Times Higher Education (http://www.timeshighereducation.co.uk) released its World Reputation Ranking. The ranking employs survey consultation among invited-only academics to measure reputation among several universities. It is assumed to be the world’s largest opinion survey of this sort across the globe. Every year, a list of the top 100 most powerful university brands is released. Despite

Read more »

Tapping the FourSquare Trending Venues API with R

March 4, 2013
By
Tapping the FourSquare Trending Venues API with R

I came up with the following function to tap into the FourSquare trending venues API: library("RCurl", "RJSONIO")   foursquare<-function(x,y,z){ w<-paste("https://api.foursquare.com/v2/venues/trending?ll=",x,"&radius=2000&oauth_token=",y,"&v=",z,sep="") u<-getURL(w) test<-fromJSON(u) locationname="" lat="" long="" zip="" herenowcount="" likes="" for(n in 1:length(test$response$venues)) { locationname = test$response$venues]$name lat = test$response$venues]$location$lat long = test$response$venues]$location$lng zip = test$response$venues]$location$postalCode herenowcount<-test$response$venues]$hereNow$count likes<-test$response$venues]$likes$count xb<-as.data.frame(cbind(locationname, lat, long, zip, herenowcount, likes)) } xb$pulled=date() return(xb)

Read more »

Track the bookies’ favourites for the next Pope

March 4, 2013
By
Track the bookies’ favourites for the next Pope

Tired of manually running a python script to scrape the latest bookmaker odds on the next Pope, R user AJ (an analytical research manager at a large healthcare company) instead created an R script to track the odds on the Papal successor, and automated it with the Shiny package for R. The screenshot below shows the odds of each...

Read more »

Revolution Analytics News Roundup

March 4, 2013
By

Between the Strata conference and various announcements, last week was certainly a busy one for the crew here at Revolution Analytics. So I thought I'd take the opportunity to catch you up on some of the recent media articles you might have missed: The Wall Street Journal interviewed our new VP of Services Neera Talbert on the trend towards...

Read more »

Great Infographic

March 4, 2013
By

This is a really great exposition on an infographic. Note that the design elements and "chart junk" serve to better connect and communicate the data to the viewer. The choice not to go with pie charts for the first set of plots is a good one. The drawbacks of polar representations of proportions is very

Read more »

Pricing of a financial product : A pricer of a call option.

March 4, 2013
By
Pricing of a financial product : A pricer of a call option.

The financial market is not only made of stock options. Other financial products enable market actors to target specific aims. For example, an oil buyer like a flight company may want to cover the risk of increase in the price of oil. In this case it i...

Read more »

What Happened Then? Using Approximated Twitter Follower Accession to Identify Political Events

March 4, 2013
By
What Happened Then? Using Approximated Twitter Follower Accession to Identify Political Events

Following a chat with @andypryke, I thought I’d try out a simple bit of feature detection around approximated follower acquisition charts (e.g. Estimated Follower Accession Charts for Twitter) to see if I could detect dates around which there were spikes in follower acquisition. So for example, here’s the follower acquistion chart for Seem Malhotra: We

Read more »

Stan in L.A. this Wed 3:30pm

March 4, 2013
By
Stan in L.A. this Wed 3:30pm

Michael Betancourt will be speaking at UCLA: The location for refreshment is in room 51-254 CHS at 3:00 PM. The place for the seminar is at CHS 33-105A at 3:30pm – 4:30pm, Wed 6 Mar. The post Stan...

Read more »

PyStan!

March 4, 2013
By

Stan is written in C++ and can be run from the command line and from R. We’d like for Python users to be able to run Stan as well. If anyone is interested in doing this, please let us know and we’d be happy to work with you on it. Stan, like Python, is completely The post PyStan!...

Read more »

Shiny with PerformanceAnalytics Example

March 4, 2013
By
Shiny with PerformanceAnalytics Example

The folks at Rstudio have done some amazing work with the shiny package. From the shiny homepage, “Shiny makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use.” Developing web applications has always appealed to me, but hosting, learning javascript, html, etc. made me put … Continue reading...

Read more »

metvurst now a package, repository moved to GitHub

March 3, 2013
By
metvurst now a package, repository moved to GitHub

Inspired by a post on PirateGrunt, I finally managed to pack metvurst up and turn it into a proper R-Package (the fact that I’m on holiday and have some time also helped). As a side-effect of this, the repository has been moved from … Continue reading →

Read more »

resizing plot panels to fit data distribution

March 3, 2013
By
resizing plot panels to fit data distribution

I am a big fan of lattice/latticeExtra. In fact, nearly all visualisations I have produced so far make use of this great package. The possibilities for customisation are endless and the amount of flexibility it provides is especially valuable for … Continue reading →

Read more »

visualising diurnal wind climatologies

March 3, 2013
By
visualising diurnal wind climatologies

In this post I want to highlight the second core function of the metvurst repository (https://github.com/tim-salabim/metvurst): The windContours function It is intended to provide a compact overview of the wind field climatology at a location and plots wind direction and … Continue reading →

Read more »

Sponsors

Mango solutions



RStudio homepage



Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training

datasociety

http://www.eoda.de





ODSC

ODSC

CRC R books series





Six Sigma Online Training









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