## Veterinary Epidemiologic Research: Linear Regression Part 2 – Checking assumptions

March 6, 2013
By

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

## 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...

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

March 6, 2013
By

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...

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

March 6, 2013
By

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 »

## A volatility filter using historical vol

March 6, 2013
By

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...

## 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

## Exporting plain, lattice, or ggplot graphics

March 6, 2013
By

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...

## 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...

## Le Monde puzzle [#810]

March 5, 2013
By

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

## Predicted correlations and portfolio optimization

March 5, 2013
By

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...

## Easily plotting grouped bars with ggplot #rstats

March 5, 2013
By

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 →

## Load Balanced Parallelization with snowfall

March 5, 2013
By

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...

## 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 »

## Create an R package from a single R file with roxyPackage

March 5, 2013
By

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...

## Visualizing neural networks from the nnet package

March 4, 2013
By

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

## Cluster Risk Parity back-test

March 4, 2013
By

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.

## 2013 World Universities Ranking

March 4, 2013
By

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

## Tapping the FourSquare Trending Venues API with R

March 4, 2013
By

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)

## Track the bookies’ favourites for the next Pope

March 4, 2013
By

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...

## 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...

## 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

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

March 4, 2013
By

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...

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

March 4, 2013
By

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

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

March 4, 2013
By

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...

## 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!...

## Shiny with PerformanceAnalytics Example

March 4, 2013
By

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...

## metvurst now a package, repository moved to GitHub

March 3, 2013
By

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 →

## resizing plot panels to fit data distribution

March 3, 2013
By

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 →

## visualising diurnal wind climatologies

March 3, 2013
By

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 →

## Recent popular posts

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