I've done a number of searches for this and haven't found what I'm looking for, although it's quite possible I'm not using the correct terms.
I'm trying to write some code (Javascript, but the math should be the same in any language) to simulate a value that is weighted towards a specific number (the first parameter), but has a range that it can possibly get to (second number is the range). As an example, think of a room with the thermostat set to 70 for both heating and cooling. In the course of a day it will probably vary from 68 to 72 but it stays pretty close to 70. Occasionally it might make it up to 80, or down to 70, but in those cases it should quickly bounce back to around 70.
Without any other name to go by I'm calling it a rubber band metric, so it may stretch a bit either way but it always goes back. So for the above, the call might be rubberBand(70, 10), for an average of 70 and a max range of 10.
The other trick is that this is a running number, not completely random with every call, and the value is stored in an object. So if the current number was 70 when it was called it has some percent chance of either going up, down, or staying the same. If it was 75, it has a much higher percent chance of lowering to 70 than it does raising to 80, but it's still possible. When it's 80, it has a minuscule chance of staying, and a very high chance of bouncing back towards 70. The max step value is also configurable within the object, but it would be a factor in how far the number could change within any given call.
Does this make sense? Is this the proper forum? And if so, what kind of equations am I looking for?
Thank you.