Archive for mid-term exams

inverse Gaussian trick [or treat?]

Posted in Books, Kids, R, Statistics, University life with tags , , , , , , , , , , , , , , on October 29, 2020 by xi'an

When preparing my mid-term exam for my undergrad mathematical statistics course, I wanted to use the inverse Gaussian distribution IG(μ,λ) as an example of exponential family and include a random generator question. As shown above by a Fortran computer code from Michael, Schucany and Haas, a simple version can be based on simulating a χ²(1) variate and solving in x the following second degree polynomial equation

\dfrac{\lambda(x-\mu)^2}{\mu^2 x} = v

since the left-hand side transform is distributed as a χ²(1) random variable. The smallest root x¹, less than μ, is then chosen with probability μ/(μ+x¹) and the largest one, x²=μ²/x¹ with probability x¹/(μ+x¹). A relatively easy question then, except when one considers asking for the proof of the χ²(1) result, which proved itself to be a harder cookie than expected! The paper usually referred to for the result, Schuster (1968), is quite cryptic on the matter, essentially stating that the above can be expressed as the (bijective) transform of Y=min(X,μ²/X) and that V~χ²(1) follows immediately. I eventually worked out a proof by the “law of the unconscious statistician” [a name I do not find particularly amusing!], but did not include the question in the exam. But I found it fairly interesting that the inverse Gaussian can be generating by “inverting” the above equation, i.e. going from a (squared) Gaussian variate V to the inverse Gaussian variate X. (Even though the name stems from the two cumulant generating functions being inverses of one another.)

the Force awakens… some memories

Posted in Books, Kids, pictures, Travel with tags , , , , , , on January 10, 2016 by xi'an

In what may become a family tradition, I managed to accompany my daughter to the movies on the day off she takes just before her medical school finals. After last year catastrophic conclusion to the Hobbit trilogy, we went to watch the new Star Wars on the day it appeared in Paris. (Which involved me going directly to the movie theatre from the airport, on my way back from Warwick.) I am afraid I have to admit I enjoyed the movie a lot, despite my initial misgivings and the blatant shortcomings of this new instalment.

Indeed, it somewhat brought back [to me] the magic of watching the very first Star Wars, in the summer of 1977 and in a theatre located in down-town Birmingham, to make the connection complete! A new generation of (admittedly implausible) heroes takes over with very little help from the (equally implausible) old guys (so far). It is just brilliant to watch the scenario unfold towards the development of those characters and tant pis! if the battle scenes and the fighters and the whole Star Wars universe has not changed that much. While the new director has recovered the pace of the original film, he also builds the relations between most characters towards more depth and ambiguity. Once again, I like very much the way the original characters are treated, with just the right distance and irony, a position that would not have been possible with new actors. And again tant pis! if the new heroes share too much with the central characters of Hunger Games or The Maze Runner. This choice definitely appealed to my daughter, who did not complain in the least about the weaknesses in the scenario and about the very stretched ending. To the point of watching the movie a second time during the X’mas vacations.

Buffon needled R exams

Posted in Books, Kids, R, Statistics, University life with tags , , , , , , , on November 25, 2013 by xi'an

Here are two exercises I wrote for my R mid-term exam in Paris-Dauphine around Buffon’s needle problem. In the end, the problems sounded too long and too hard for my 3rd year students so I opted for softer questions. So recycle those if you wish (but do not ask for solutions!)