Need to find a function to approximate this data distribution

tchntm43

New member
Joined
Jan 8, 2020
Messages
36
(I'm not really sure what counts as beginner vs intermediate/advanced, but I had to pick a board and I picked this one)

I need to find a formula to represent a decay-over-time situation. There is some room for flexibility (as long as it's roughly what I'm after, that's good enough). Here are the guidelines:
1. x is amount of time passed, y is proportion of original value remaining
2. x=0, y=1 (obvious)
3. The slope of the curve at x=0 should be 0 or close to it
4. x=20, y=0.5, and the slope here should be at the maximum negative value of the whole curve
5. for x > 20, y asymptotically approaches 0.05. It should be close to that value by x=40.
6. X is never less than 0, so there is no need to worry about what the function produces for those values where x < 0.
7. This is going into an Excel formula, so I'm open to a simpler formula that might be a bit less precise.

Here is a quick mock-up done in Photoshop to clarify any confusion.
1624540800733.png

I can get the desired horizontal asymptote easily enough using a function of the form y = a/bx + 0.05. However, this also creates a vertical asymptote at x=0. I would be fine having a second horizontal asymptote at y=1 and then just specifying a conditional that if x=0, y=1, but I am actually not sure how to have a function that creates two horizontal asymptotes.
 
(I'm not really sure what counts as beginner vs intermediate/advanced, but I had to pick a board and I picked this one)

I need to find a formula to represent a decay-over-time situation. There is some room for flexibility (as long as it's roughly what I'm after, that's good enough). Here are the guidelines:
1. x is amount of time passed, y is proportion of original value remaining
2. x=0, y=1 (obvious)
3. The slope of the curve at x=0 should be 0 or close to it
4. x=20, y=0.5, and the slope here should be at the maximum negative value of the whole curve
5. for x > 20, y asymptotically approaches 0.05. It should be close to that value by x=40.
6. X is never less than 0, so there is no need to worry about what the function produces for those values where x < 0.
7. This is going into an Excel formula, so I'm open to a simpler formula that might be a bit less precise.

Here is a quick mock-up done in Photoshop to clarify any confusion.
View attachment 27957

I can get the desired horizontal asymptote easily enough using a function of the form y = a/bx + 0.05. However, this also creates a vertical asymptote at x=0. I would be fine having a second horizontal asymptote at y=1 and then just specifying a conditional that if x=0, y=1, but I am actually not sure how to have a function that creates two horizontal asymptotes.
How about y = e^(-x^2)
 
Extending post#2 (see graph). The blue is more aesthetic IMO (but it has the steepest descent moved to the left at approx x=17.3)
y = 0.95*e^(-(0.0464*x)^3.9) + 0.05
y = 0.95*e^(-(0.0438*x)^2.2) + 0.05

graph.png

I did the work for you because I get the impression that this isn't a student study question!
Let y = e^(-x^p)

Introduce the offset from the x-axis o=0.05

y = (1-o) * e^(-x^p) + o

Scale horizontally so that x=20 when y=0.5

y = (1 - o)*e^(-( c*x )^p) + o

Where c = (-ln((0.5 - o)/(1 - o)))^(1/p)/20 due to requirements

Then choose your favourite p value.
 
Very interesting... The red line is actually closer to what I'm looking for (I want it to stay close to the x=0 value for a little before dropping).

Oh, I should have mentioned this is definitely not a student question, haha. I'm working on a model for election predictions based on polling, and I needed a decay multiplier to apply to poll weight so that as the poll becomes older, it becomes less relevant in the model. The old model had a linear decay rate that would zero out after about 30 days, but I've decided I want to keep the data still present, just at a very small amount.

Thanks a lot!
 
Top