views:

62

answers:

2

I would like a web interface for a user to describe a one-dimensional real-valued function. I'm imagining the user being presented with a blank pair of axes and they can click anywhere to create points that are thick and draggable. Double-clicking a point, let's say, makes it disappear. The actual function should be shown in real time as an interpolation of the user-supplied points.

Here's what this looks like implemented in Mathematica (though of course I'm looking for something in javascript):

A: 

Remember that a probability distribution has to be monotonically non-decreasing over its entire run, which your example is not. Even worse, that small dip is not due to user error -- their points are increasing as required -- but is an artifact of the interpolation method. If you use linear interpolation, then any non-monotonicity is your user's fault, and you can warn them.

Amos Newcombe
Good point about linear interpolation. I might even want to interpolate such that the resulting function was always monotone regardless of where the user placed the points. In any case, the choice of how to interpolate should be the easy part of this...
dreeves
A: 

The Distribution Builder tool by Dan Goldstein has an alternative interface for eliciting probability distributions.

dreeves