Re: Derivation of the Cost Function

Thanks! That makes it much clearer for me.

The graph at 
https://docs.google.com/document/d/1kx62tpy5hGIbHh6tHMAryon9Sgye--W_IsHTeCMlmEo/edit#

has M= 100 but the Python has M = 1000. Which is correct, for the final 
version of the cost function?

Also, I have a screenshot of the sigmoid graph for now but would love to 
see the graph as a separate graphic, if that is convenient?

On 2020-10-07 02:30, Garret Rieger wrote:
> Here's how the cost function as presented here 
> <https://docs.google.com/document/d/1kx62tpy5hGIbHh6tHMAryon9Sgye--W_IsHTeCMlmEo/edit#heading=h.4fz1x8661i63> was 
> derived:
>
>   * Start with the logistic function (a sigmoid): M/ ( 1 + e^(-k(x -
>     x_0)))
>   * M is the maximum height of the function.
>   * k scales the width of the function
>   * and x_0 shifts the function left/right.
>
> We want a function that starts rising at x = T_z and hits it's maximum 
> at T_m:
>
>   * Width of the period it rises over is W = T_m - T_z
>   * Scale k = K / W. Where K is a hand selected constant which
>     controls the width. By dividing by W we normalize the scale
>     against the width. A value of K = 11.5 was found to give a near
>     maximum and minimum value at T_z and T_m.
>   * x_0 = W/2 + T_z = T_m/2 - T_z/2 + T_z = T_m/2 + T_z/2
>       o  This moves the function W/2 units to the right (the logistic
>         function starts centered on x = 0)
>       o And then an additional T_z to the right to add the initial
>         period of zero cost.
>
> If you plug that all into M / (1 + e^(-k(x - x_0))) you get:
>
> M / ( 1 + e^(-11.5/(T_m-T_z) * ( x - T_m/2 - T_z/2)))
>
> There's a similar explanation in the actual implementation in code: 
> https://github.com/w3c/PFE-analysis/blob/master/analysis/cost.py 
> <https://github.com/w3c/PFE-analysis/blob/master/analysis/cost.py>

-- 
Chris Lilley
@svgeesus
Technical Director @ W3C
W3C Strategy Team, Core Web Design
W3C Architecture & Technology Team, Core Web & Media

Received on Wednesday, 7 October 2020 15:02:47 UTC