# Posts Tagged ‘ R ’

## another viral math puzzle

May 24, 2015
By

After the Singapore Maths Olympiad birthday problem that went viral, here is a Vietnamese primary school puzzle that made the frontline in The Guardian. The question is: Fill the empty slots with all integers from 1 to 9 for the equality to hold. In other words, find a,b,c,d,e,f,g,h,i such that a+13xb:c+d+12xe–f-11+gxh:i-10=66. With presumably the operation […]

## My favorite R bug

May 23, 2015
By

In this note am going to recount “my favorite R bug.” It isn’t a bug in R. It is a bug in some code I wrote in R. I call it my favorite bug, as it is easy to commit and (thanks to R’s overly helpful nature) takes longer than it should to find. The … Continue reading My favorite R bug → Related posts: My Favorite Graphs Random Test/Train…

## Parametric Inference: Likelihood Ratio Test Problem 2

May 23, 2015
By

More on Likelihood Ratio Test, the following problem is originally from Casella and Berger (2001), exercise 8.12.ProblemFor samples of size $n=1,4,16,64,100$ from a normal population with mean $\mu$ and known variance $\sigma^2$, plot the power functio...

## Simulation-based power analysis using proportional odds logistic regression

May 22, 2015
By

Consider planning a clinicial trial where patients are randomized in permuted blocks of size four to either a 'control' or 'treatment' group. The outcome is measured on an 11-point ordinal scale (e.g., the numerical rating scale for pain). It may be reasonable to evaluate the results of this trial using a proportional odds cumulative logit […]

## How Predictable is the English Premier League?

May 19, 2015
By

The reason why football is so exciting is uncertainty. The outcome of any match or league is unknown, and you get to watch the action unfold without knowing what’s going to happen. Watching matches where you know the score is never exciting. This weekend the English Premier League season will conclude with little fanfare. Bar […]

## Posterior predictive output with Stan

May 19, 2015
By

I continue my Stan experiments with another insurance example. Here I am particular interested in the posterior predictive distribution from only three data points. Or, to put it differently I have a customer of three years and I'd like to predict the ...

## New in forecast 6.0

May 15, 2015
By

This week I uploaded a new version of the forecast package to CRAN. As there were a lot of changes, I decided to increase the version number to 6.0. The changes are all outlined in the ChangeLog file as usual. I will highlight some of the more important changes since v5.0 here. ETS One of […]

## the Flatland paradox

May 12, 2015
By

Pierre Druilhet arXived a note a few days ago about the Flatland paradox (due to Stone, 1976) and his arguments against the flat prior. The paradox in this highly artificial setting is as follows:  Consider a sequence θ of N independent draws from {a,b,1/a,1/b} such that N and θ are unknown; a draw followed by its […]

## terrible graph of the day

May 12, 2015
By

A truly terrible graph in Le Monde about overweight and obesity in the EU countries (and Switzerland). The circle presentation makes no logical sense. Countries are ordered by 2030 overweight percentages, which implies the order differs for men and women. (With a neat sexist differentiation between male and female figures.)  The allocation of the (2010) […]

## Hello Stan!

May 12, 2015
By

In my previous post I discussed how Longley-Cook, an actuary at an insurance company in the 1950's, used Bayesian reasoning to estimate the probability for a mid-air collision of two planes.Here I will use the same model to get started with Stan/RStan,...