Finding roots of functions in actuarial science

December 7, 2010
By
Finding roots of functions in actuarial science

The following simple code can be used to find roots of functions (based on the secant algorithm), secant=function(fun, x0, x1, tolerence=1e-07, niter=500){for ( i in 1:niter ) { x2 <- x1-fun(x1)*(x1-x0)/(fun(x1)-fun(x0)) if (abs(fun(x2)) < to...

Read more »

Kendall Rank Coefficient by GPU

December 7, 2010
By
Kendall Rank Coefficient by GPU

The correlation coefficient is a measurement of correlation between two random variables. While its computation is straightforward, it is not readily applicable to non-parametric statistics. read more

Read more »

Webinar: Revolution R is 100% R and More

December 7, 2010
By

I'll be hosting a webinar tomorrow (Wednesday) aimed at R users who want to know more about how Revolution R Enterprise extends open source R for big data, Web services, multi-core processing, debugging and more. For R users at schools and universities, I'll also explain how you can download and use Revolution R Enterprise free of charge. The full...

Read more »

Webinar: Revolution R is 100% R and More

December 7, 2010
By

I'll be hosting a webinar tomorrow (Wednesday) aimed at R users who want to know more about how Revolution R Enterprise extends open source R for big data, Web services, multi-core processing, debugging and more. For R users at schools and universities, I'll also explain how you can download and use Revolution R Enterprise free of charge. The full...

Read more »

Sequential Line Plots in R

December 7, 2010
By
Sequential Line Plots in R

I was trying to create some sequential plots today in R to analyse some MCMC simulations. I found the par(ask=TRUE) command very useful for looking at iterations of individual parameter values. Setting the ask graphical parameter to TRUE (before a … Continue reading →

Read more »

Webinar on Revolution R Enterprise

December 7, 2010
By

R evangelist David Smith, marketing VP at Revolution R, will be giving a webinar showing off some of the finer features of Revolution R Enterprise - an integrated development environment (IDE) for R that has an enhanced script editor with syntax highli...

Read more »

Statistique de l’assurance STT6705V, partie 12 bis

December 7, 2010
By
Statistique de l’assurance STT6705V, partie 12 bis

In the previous post (here) discussing forecasts of actuarial quantities, I did not mention much how to forecast the temporal component in the Lee-Carter model. Actually, many things can be done. Consider here some exponential smoothing techniques ...

Read more »

Le Monde puzzle [49]

December 7, 2010
By
Le Monde puzzle [49]

Here is a quick-and-dirty solution to Le Monde puzzle posted a few days ago: the R code counts the number of winning tickets between 1 and N, and stops when there is a proportion of 10% of winning tickets. #winning ticket win=function(n){ #decimal digits decomposition x=rep(0,4) x=n%%10 m=(n-x)/10 x=m%%10 m=(m-x)/10 x=m%%10 m=(m-x)/10 x=m%%10 tic=0 for

Read more »

highlight 0.2-5

December 7, 2010
By

I pushed highlight 0.2-5 on CRAN. This release improves the latex renderer and the sweave driver so that multiple lines character strings are properly rendered. This example vignette shows it: \documentclass{report} \begin{document} <<echo=FALSE,results=hide>>= old.op <- options( prompt = " ", continue = " " ) @ <<>>= require( inline ) require( Rcpp ) convolve <- cxxfunction( signature( a = "numeric", b...

Read more »

R 2.12.1 scheduled for December 16

December 6, 2010
By

The next update to R will be a patch release: R 2.12.1 will be released on December 16, as announced today by the R Core Team. As is typical for a patch release, this version will include some minor bug fixes plus a few new features (from the current build's NEWS file): The DVI/PDF reference manual now includes the...

Read more »

R 2.12.1 scheduled for December 16

December 6, 2010
By

The next update to R will be a patch release: R 2.12.1 will be released on December 16, as announced today by the R Core Team. As is typical for a patch release, this version will include some minor bug fixes plus a few new features (from the current build's NEWS file): The DVI/PDF reference manual now includes the...

Read more »

Jeromy Anglim on Reproducible Research and R

December 6, 2010
By

Jeromy Anglim, fellow social scientist and R aficionado from across the globe, gave a great talk to the Melbourne R Users Group last week on the joys of creating reproducible results. A subject near and dear to me, but not one that is given enough attention in research training. Jeromy discusses tools for generating reproducible

Read more »

What my R code looks and feels like (Vanilla)

December 6, 2010
By

Geoff Robinson discusses how to write simple and reusable R code. He provides several examples with code.

Read more »

Reproducible Research and R Workflow

December 6, 2010
By

Jeromy Anglim discusses best practices and tools used to support reproducible research in R. He discusses tools for R scripting and version control; and provides examples of SWeave. This presentation was given to the Melbourne R Users Group (MelbURN)...

Read more »

3 weak days in a row

December 6, 2010
By
3 weak days in a row

Recently, Trading the odds posted one of many flavors of mean reverting strategies and I decided to get my hands dirty by writing R code and testing it. You can find full description of the strategy by following latter link above. Long story short – if SPY shows lower open, high and close 3 days in

Read more »

JAGS – Bayesian Analysis

December 6, 2010
By
JAGS – Bayesian Analysis

JAGS is used for Bayesian analysis using MCMC and stands for Just Another Gibbs Sampler.  It is an alternative to WinBUGS and can be accessed through R just like WinBUGS (via R2jags or RJags).  It will work on a Mac unlike WinBUGS.  The ...

Read more »

Using the "Divide by 4 Rule" to Interpret Logistic Regression Coefficients

December 6, 2010
By

I was recently reading a bit about logistic regression in a book on hierarchical/multilevel modeling when I first learned about the "divide by 4 rule" for quickly interpreting coefficients in a logistic regression model in terms of the predicted probabilities of the outcome. The idea is pretty simple. The logistic curve (predicted probabilities) is steepest at the center where...

Read more »

Example 8.17: Logistic regression via MCMC

December 6, 2010
By
Example 8.17: Logistic regression via MCMC

In examples 8.15 and 8.16 we considered Firth logistic regression and exact logistic regression as ways around the problem of separation, often encountered in logistic regression. (Re-cap: Separation happens when all the observations in a category sha...

Read more »

Electoral Marimekko Plots

December 6, 2010
By
Electoral Marimekko Plots

To be reductive, visual displays of quantitative information might be reasonably categorized on a continuum between “data display” and “statistical graphics.” By statistical graphics, I mean a plot that displays some summary of or relationship amongst several variables, likely having undergone some processing or analysis. This may be as simple as a scatterplot of a … Continue reading →

Read more »

Bear hunting

December 6, 2010
By
Bear hunting

When were there bear and bull markets in US stocks since 1950? Smoothing While we’d really like to estimate the expected return at each point in time, finding bear markets is ambitious enough.  The plan starts by smoothing the daily returns through time, as in Figure 1. Figure 1: Smoothed returns with a 4 year … Continue reading...

Read more »

Forecasting workshop: Switzerland, June 2011

December 6, 2010
By
Forecasting workshop: Switzerland, June 2011

I will be running a workshop on Statistical Forecasting: Principles and Practice in Switzerland, 20-22 June 2011. Check out the venue: Waldhotel Doldenhorn, Kandersteg! So if you fancy a trip to the beautiful Swiss Alps next June, read on… Outline Forecasting is required in many situations: deciding whether to build another power generation plant in

Read more »

R 2.12.0 and Eclipse with StatET installation

December 5, 2010
By

A while back I outlined the setup process for running R under the Eclipse integrated development environment with the help of WalWare.de’s StatET plugin for Eclipse, in Windows 7. This post is an update on that procedure for the newer versions of...

Read more »

Bayesian adaptive sampling

December 5, 2010
By
Bayesian adaptive sampling

In the continuation of my earlier post on computing evidence, I read a very interesting paper by Merlise Clyde, Joyee Ghosh and Michael Littman, to appear in JCGS. It is called  Bayesian adaptive sampling for variable selection and model averaging. The sound idea at the basis of the paper is that, when one is doing

Read more »

Rethinking ‘loess’ for Binomial-Response Pitch F/X Strike Zone Maps

December 5, 2010
By
Rethinking ‘loess’ for Binomial-Response Pitch F/X Strike Zone Maps

So after a long hiatus, I'm back for today. I've been crazy busy with a number of different things--including getting engaged and helping plan out wedding dates and things of that sort--and unfortunately have not kept up here on this blog (or on Fanta...

Read more »

Pareto plot party!

December 5, 2010
By
Pareto plot party!

A Pareto plot is an enhanced bar chart. It comes in useful for deciding which bars in your bar chart are important. To see this, take a look at some made up DVD sales data. set.seed(1234) dvd_names <- c("Toy Tales 3", "The Dusk Saga: Black Out", "Urban Coitus 2", "Dragon Training for Dummies", "Germination", "Fe

Read more »

Genetic optimization for Trading Strategies using Rapidminer and R

December 5, 2010
By
Genetic optimization for Trading Strategies using Rapidminer and R

That is the second tutorial of Rapidminer and R extension for Trading and the first in Video. In the last example the ROC obtained is not as good as it should be to make money in this business, To improve the strategy we will try to optimize the trading strategy. Different methods of optimization and objective functions...

Read more »

Genetic optimization for Trading Strategies using Rapidminer and R

December 5, 2010
By
Genetic optimization for Trading Strategies using Rapidminer and R

That is the second tutorial of Rapidminer and R extension for Trading and the first in Video. In the last example the ROC obtained is not as good as it should be to make money in this business, To improve the strategy we will try to optimize the trading strategy. Different methods of optimization and objective functions...

Read more »

GLMM and R issues

December 4, 2010
By
GLMM and R issues

I have been trying to run a Generalized Linear Mixed Model (GLMM) for some count data with repeated measures on sub-sampled sites and fixed effects at the site level with covariates at both the sub-plot and time levels.  Plus there are different n...

Read more »

Comparison of results

December 4, 2010
By

I am doing a simple comparison of different estimation procedures in dealing with a simple binomial model. Here is where I got started:---------------------------------------------library(INLA)library(npmlreg)library(MCMCglmm)library(DPpackage)data(See...

Read more »