Thanks again to Peter Green for the R code. Image is below, but you should really go here for the interactive SVG version.
Peter also supplied these charts to show what’s happened to National’s poll ratings since last year’s election. One of the end-of year refrains in political summaries is that National ‘held steady in the polls’ despite a terrible year. Well, they did hold pretty steady compared to the election result. But the polls all massively over-estimated National’s election result – if you compare current poll estimates with pre-election poll estimates then National is way down. (It looks like Roy Morgan may have corrected their methodology post-election, the other firms not so much.)
Peter also provided this summary of the statistical modeling used to generate the aggregated graph:
The smoothed curves are calculated using a generalised additive model (GAM). The smoothing parameter is estimated using cross-validation. This means that the curves are estimated based on subsets of the data, and the parameter that best predicts the hold-out data is chosen. Note that the error bounds are based on the assumption that the smoothing parameter is correct, i.e. uncertainty in the smoothing parameter estimate are not accounted for.A separate smoothed curve is estimated for each combination of polling firm and party (the election is treated as a poll and given more weight than the opinion polls). The shape of the curves for each party is constrained to be the same for every polling firm, although they can be vertically offset from each other. The displayed curve is aligned so that it passes through the election result, but in the interactive version you can see the offset curves for each polling outfit.