This gave me a reason (excuse?) to tackle something on my to-do list: learning to use Shiny to create an interactive document containing statistical analysis (or at least statistical mumbo-jumbo). I won't repeat the full discussion here, but instead will link the Shiny document I created. It lets you tweak settings for an example of a reciprocal normal variable and judge for yourself how well various normal approximations fit. I'll just make a few short observations here:
- No way does YY actually have a normal distribution.
- Dividing by XX suggests that you probably should be using a distribution with finite tails (e.g., a truncated normal distribution) for XX. In particular, the original question had XX being speed of something, kk being (fixed) distance to travel and YY being travel time. Unless the driver is fond of randomly jamming the gear shift into reverse, chances are XX should be nonnegative; and unless this vehicle wants to break all laws of physics, XX probably should have a finite upper bound (check local posted speed limits for suggestions). That said, I yield to the tendency of academics to prefer tractable/well-known approximations (e.g., normal) over realistic ones.
- The coefficient of variation of XX will be a key factor in determining whether approximating the distribution of YY with a normal distribution is "good enough for government work". The smaller the coefficient of variation, the less likely it is that XX wanders near zero, where bad things happen. In particular, the less likely it is that XX gets anywhere near zero, the less skewness YY suffers.
- There is no one obvious way to pick parameters (mean and standard deviation) for a normal approximation to YY. I've suggested a few in the Shiny application, and you can try them to see their effect.
- R (version 3.1.1) to do the computations;
- R Studio as the IDE for development (highly recommended);
- R Markdown as the "language" for the document;
- Shiny to handle the interactive parts;
- various R packages/tools to generate the final product.
No comments:
Post a Comment
Due to intermittent spamming, comments are being moderated. If this is your first time commenting on the blog, please read the Ground Rules for Comments. In particular, if you want to ask an operations research-related question not relevant to this post, consider asking it on Operations Research Stack Exchange.