Aslak Grinsted >
Misc. Debris
Digitizing pdf figures using inkscape
I recommend using inkscape if you want to digitize a vector figure from a pdf file. Here's how you do that.
In the example shown here the path has a set of coordinates and there are some M and C commands. Usually you can just ignore these letters, but if you are curious then you can read more on their meaning here. M means moveto, and C means curveto. When you are done, then you probably want to reallow "relative coordinates", as it results in smaller files. Digitizing nonvector bitmap figures: The svgapproach only works with vector graphics. When i need to digitize a bitmap, then I usually use digitize2 in matlab, or WebPlotDigitizer to digitize bitmap figures. 
More and Stronger Hurricane surges
I thought I would share this quite illustration on how to interpret changes in return period/return magnitude plots. Data on hurricane surges along the US Atlantic and gulf coasts indicate that more and stronger hurricane activity in globally warm years. Our statistical model used for projection of hurricane surge threat also finds this relationship. Note: that if you focus only on the most rare, and most intense events then you will not be able to tell the difference between "more intense" and "more frequent". Consensus? There is a consensus on "stronger" hurricanes in a warmer world, but not a consensus on "more" (see e.g. discussion here). It should be noted that fewer but stronger hurricanes, is not necessarily incompatible with more and stronger hurricane surges. 
Sea level, the moon, and Frankenstein
Jens Morten Hansen (JMH) and coauthors have recently published a study where they use sineregression to fit 5 oscillations plus a linear trend to a 160year sea level record from waters near Denmark (a stack of local GIA corrected tide gauge records). They then observe that the sinesplustrend model correlates highly with the record it was fitted to, after applying a 19year moving average. This should be unsurprising as the procedure guarantees high correlation, regardless of input data (see figure). This result is clearly not significant in any meaningful sense of the word. After having tuned their model to fit the data, they proceed to postrationalize the fitted model frequencies in terms of the nearest halfmultiples of the lunar nodal cycle (18.6 years). I use the word "postrationalize" to highlight that their new hypothesis is formulated in order to explain their first insignificant result. Again, this key result is clearly not significant. You can postulate any similar set of frequencies, and you would still get high correlation. This is illustrated in the figure on this page where we show how sea level can be 'predicted' using the orbital periods of five exoplanets. It is therefore not surprising that it has been hard to get this study published. After multiple rejections, it was eventually published in Journal of Coastal Research. JMH then began to publicize it in primarily danish media. Here are some of the headlines it generated:
This persistent push for publicity have prompted us to voice our critical concerns regarding this study. No, this is not a case of scientific censorship. This study has fundamental flaws and it is simply not convincing. [Update: Our criticism is now out in Aktuel Naturvidenskab and republished on videnskab.dk. Lise Brix from Videnskab.dk followed up with a thorough piece where they interview outside experts.] Our criticism  over fitting We wrote a critical comment highlighting the flaws in their analysis. It can be found here (in danish). We demonstrate by example the nonsignificance by showing how you get high correlations regardless of data set, and periods used (see figure). The plot on this page shows how we can fit pretty much any time series using the exact same lunar frequencies they used in their study. We illustrate this using data for the population in Denmark over time, and the frequency of the words "Frankenstein", and "hamlet" in books over time. We can also predict sea level using the orbital periods of exoplanets. The point is that highcorrelations are guaranteed even when there clearly is no causal link. The basic issue is overfitting: Their statistical model has 17 degrees of freedom (5 periods, 5 phases, 5 amplitudes, 1 trend, 1 constant). They test the quality of the resulting fit against 19year moving averages of a 160year series. There is at most 89 independent points in the smoothed series (and that is being generous as the timeseries is autocorrelated). Of course it will fit with a high correlation coefficient. "With four parameters I can fit an elephant, and with five I can make him wiggle his trunk"  John von Neumann On the right, I show a figure where some authors put von Neumanns statement to the test. They use a cycle model and fit it to a drawing of an elephant. Their model is remarkably similar to JMHs model but with fewer free parameters and with periodicity constraints. Posthoc rationalization of an insignificant resultJMH and coauthors were struck by the highcorrelation, and felt they needed a causal explanation. Our examples show that there is absolutely no need for an explanation as their procedure guarantees high correlations even when there is no causal link. They then comeup with what I call the lunar nodal resonance hypothesis where all sea level variability is explained by the moon. I see this as a posthoc rationalization of a (very) insignificant correlation, and I am not convinced. Armed with their new nodal resonance hypothesis, they reformulate their model with the frequencies rounded to nearest halfmultiple of the nodal cycle. They then reoptimize all the remaining parameters and 'test' whether the nodal resonance model also can fit the data. We show that this is a poor test as it is also guaranteed to give a positive result. Personally I also think the nodal resonance hypothesis is physically farfetched. I don't have a problem with the nodal cycle having a detectable effect on sea levels, but he is also arguing that multiples thereof have a large significant effect on winds (and AMO / NAO). That is quite a mental leap. In his own words: "Additionally, we have [in Denmark] documented additional cyclic oscillation with a period length of 76 years. This oscillation implies, by all accounts , that we are entering a period of more easterly wind"  Jens Morten Hansen (translated by me, original here) Other notes JMH presents the iterative handtuning of parameters as a strength, presumably because there is no incomprehensible mathematical 'magic' going on. I see the manual iterative procedure as a weakness. The manual handtuning means it probably will be impossible to exactly replicate the results. Another problem is that the iterative search is not guaranteed to result in a globally bestfitting solution. (Further, an automated procedure would also facilitate a Monte Carlo significance testing against a reasonable null.) The paper makes no serious attempt at validation. They could have done a cross calibration / validation exercise. The could also have compared their statistical hindcast to GIA adjusted versions of the longer tide gauge records from Northern Europe. Their explanatory model is entirely tidal, and thus leaves no room for climate change to have any impact on sea level. This is regardless of whether it is natural or anthropogenic climate change. But we know how glaciers have retreated globally (Zemp et al. 2015), and therefore must have contributed to sea level rise over this period. Clearly, the global mountain glacier retreat cannot be forced by the lunar nodal oscillation. This inflexibility of their statistical model exposes a fundamental problem. In a radio show from the danish national broadcasting company (DR), JMH lets us know that he and a likeminded swede tried to push the story to a major Swedish newspaper. It was rejected with a note that the newspaper never accepted letters opening with references to the Emperors new clothes. I find that particular reference ironic. A google search reveals that JMH is on the scientific board of klimarealistene in Norway. They have the motto: "it is the sun that drives climate", and their logo looks like a sun and a sine wave. Mörner is also on the board, and I wonder if he is the likeminded swede. JMH believes that it is consensus thinking and scientific censorship in the name of climate which made it hard for him to publish his 'bombshell' study (See forskeren.dk). Well, the type of cycle fitting in JMHs paper is also unconvincing to climate change skeptics: Here's Willis Eschenbach using the term "cyclomania" with respect to a somewhat similar analysis by Scafetta. Nobody can argue that Willis is part of the climate change consensus (see exhibit a). Data sources The data in the figure comes from these sources: Sea level digitized from JMHs paper. Word frequencies from google ngrams. DK population from statistikbanken.dk. exoplanet periods from openexoplanetcatalogue.com . The particular datasets were chosen based on these criteria: 1) same temporal coverage as JMHs sea level series. 2) could not be argued to be causally linked to the nodal cycle. 
Ice sheet pessimists are not outliers
Bamber and Aspinall 2013 published a formal expert elicitation on the future of our two ice sheets, and found a large spread between individual expert answers. It has been argued by them, and others that there are outlier experts in the data, and that they drive the longtails of the pooled uncertainty distribution. I wonder if that is really true or whether it could be a visual artifact from drawing samples from a long tailed distribution. When you plot samples from a long tailed distribution then of course the tail values will appear to stand out, but that does not necessarily make them outliers. The question is really whether there are two groups of experts optimists vs. pessimists or whether they all have been sampled from a continuum of experts. I focus on the expert assessment of the rate of future ice loss from the West Antarctic Ice Sheet (WAIS), as this is a key uncertainty. In particular i use the 2012 estimates shown in red in their figure 1 reproduced on this page. I have digitized this figure to obtain the low and high values of each expert range listed in the bottom of this page. No evidence for outlier expertsWhen I rank these values from low to high and plot them then I see that there is no evidence for a discontinuity in the neither experts upper, nor lower estimates. There is no split between ice sheet optimists and ice sheet pessimists. For comparison I also plot some surrogate data sampled from a lognormal distribution, so that you can see an example of how it looks when you draw a small sample from a continuous long tailed distribution. See also the final remarks at realclimate in relation to the Horton et al. paper: "There is no split into two groups that could be termed “alarmists” and “skeptics” – this idea can thus be regarded as empirically falsified" Data plotted in graph: s=[3.0 0.5;5.0 25.0;1.5 0.5;2.0 0.2;0.5 2.0;4.0 30.0;0.5 10.0;0.0 2.0;2.0 8.0;0.5 2.5;1.0 20.0;0.0 4.0;0.3 2.0]; s(:,3)=exp(randn(13,1)); s=sort(s); Technical detail: if you draw 13 samples from the surrogate distribution, then there is a 51% chance that the highest value will be greater than 5. The maximum value in the surrogate plot is thus very close to the median value for this distribution. It is not an outlier. 
Loading MOLA PEDR files in matlab
I have written a little matlab function to read the MOLA laser altimeter data from the Mars Global Surveyor. More specifically the so called Precision Experiment Data Records (PEDR) records. PEDRs are generated from the raw altimetry profile data with precision orbit corrections applied. They are timeordered binary tables with attached PDS labels. You can download the MOLA PEDR data here. Perhaps somebody will find this useful. The function is attached below. 
Thoughts on the Pachauri harassment case
Pachauri has been accused of sexual harassment. You can read about it here: Pachauri's initial defense was to claim that he didn't do it, but that his phone was hacked. That is not entirely implausible considering the history of the CRU hack. Hence I initially withheld any commentary. The climate community I follow on twitter has also mostly been quiet on this. Since then more news has surfaced. We have seen the content of some of the messages in the case, and more women have spoken out against Pachauri: I don't know if he is guilty or not, but these additional reports push me towards the womens account. I don't usually comment on gender issues, but I think it is important to publicly make it clear that sexual harassment is not OK regardless of who you are, or how much bad publicity it might give for climate science. 
A better windows experience
ChocolateyChocolatey is a package manager sort of like aptget for windows, or a commandline version of ninite. You can do stuff like:choco install <packagename> Usually you have to run choco as an administrator. That means starting the command prompt as an admin. That can get annoying pretty fast, so I recommend installing the sudo package as the next step.
choco install sudo After this you can install a bunch of other stuff using "sudo choco install xxxx" install, without starting an administrative shell. A better terminal, and putty sudo cinst conemu I installed putty manually instead of using chocolatey because that makes it easier to get conemu to cooperate with putty. see also comments here SSHFS adds the ability to mount drives over sshsudo cinst winsshfs I recommend installing FiSSH instead (a fork of winsshfs) because it is compatible with pageant. I have not tested if it is better than this fork. SublimeTextsudo cinst SublimeText3 sudo cinst SublimeText3.powershellalias Python2.xx (& essentials)For scientific python you might want to try Anaconda instead of installing python yourself. That is not in the chocolatey. Note this python section is from memory and may not be optimal. sudo cinst python2 pip install upgrade pip pip install virtualenv pip install virtualenvwrapperwin If PIP is not found, then it is most likely a problem with your path. 
Bayesian exercises for Inverse problems
Below is a pdf with some exercises for that i use in my course on inverse problems. Problem 0: Goal understand why it is attractive to use loglikelihoods over likelihoods. Problem 1: An exact model with a single model parameter. This makes easy to plot. Problem 2: A variant of problem 1 with an inexact model. Problem 3: Goal: Show that it is easier to calculate derived quantities such as "expected value" of the posterior when you use mcmc. Problem 4: A problem where it is easy to understand why is the likelihood called a likelihood. Problem 5: A problem where you have to grasp many concepts. Exercises 4 & 5 are probably the most fun. 
Tracking ice motion in Landsat 8
I have been attempting to track ice motion in landsat 8 files. I have only been able to find the L1T files. These are terrain corrected files. Unfortunately for my study region (the Renland ice cap, East Greenland) the DEM used in this processing is of too poor quality and which introduces large geodetic errors. DEM errors can be seen as residual perspective effects [Click image on the right to expand to an animated GIF showing flipping between two images]. If you know where to get L1G, then please email me!I would therefore really like to have the L1G product and account for the terrain correction my self (using gimpdem). Another advantage of L1G over L1T is that there is less resampling which degrades feature tracking performance. (This work is partly motivated by testing a new open source feature tracking & georeferencing toolbox for matlab we have been working on. I am looking forwards to putting it on github.) Descriptions of the levels of processing

West Antarctic collapse in the IPCC reports
I have extracted some quotes from the IPCC reports since 1990 showing how West Antarctic Ice Sheet collapse has been discussed over time. It is not an exhaustive list.
See also these posts:

110 of 72