.. code originally developed by Eric Christoffersen
for merging data from virtual rides where distance is
recorded on a trainer, so the GPS and altitude data
can be merged in to the data.
Even when it is considered not relevant for runs and swims the metric
code computes the value if power data is present which may produce
unwanted results as reported at the users forum.
.. banister(metric, nte|pte|perf|cp)
so you can filter rides where predicted cp is over
300 with "banister(BikeScore, cp) > 300".
.. of course the real value is being able to access
banister data in metrics and formulas.
.. don't show helper in data table or compare mode.
.. always extend out banister date range to at least
a year from the current date. To make sure the
decay is calculated well into the future.
.. split if no gaps in seasons and combine if seasons
are too short.
.. this way we get fairly stable fits (2yr window size)
but also get to see parameters reflect aging, so
p0 declines and k1/k2 fit better.
.. still need to think how t1/t2 should adjust...
.. can refit to see affect of adjusting parameters.
.. doesn't "remember" them, need to think about what
that should mean (config in chart, season or athlete?)
.. also made t1/t2 fixed in the fit process so we have
fewer parameters and need less data to fit.
.. added a banister helper like on the CP plot
.. you can't adjust T1 and T2 yet, thats coming
in the next commit
.. also a few fixups related to submax filtering
of performances and some wip regarding how
the model fit works (windows, t1+t2 fixed etc).
.. Banister implementation is still under some
development, testing and validation but is in
good enough shape to try with your data.
.. we only have banister curves where there is data
so if there are gaps between seasons we should not
plot any data.
.. as a result also fixed bug that the qwt gapped
curve would always plot first zero in a curve.
.. Banister model fitting using LM
.. can plot Banister curves on trends plots;
- Performance curve (NTE+PTE)
- Predicted CP curve (Performance curve scaled)
- Negative Training Effect
- Positive Training Effect
.. the code is sub-optimal and needs to be refactored
to cache and refresh less frequently (using the same
pattern as PMC most likely).
.. the model fitting can fail and needs to be made a
lot more robust, along with ensuring the samples
we fit to are appropriate.
.. filter out submax performances
.. plot performances on LTMplot;
* tests - marked as TTEs by user
* weekly performances - found by algorithm
* submaximal performances - filtered out by algorithm
.. we now have the neccessary data to introduce the
Banister NTE/PTE and Performance curves in the next commit.
.. show weekly best performances (ready for banister curves)
.. show performance tests (also used by banister if present)
.. can toggle which ones to show.
.. use powerIndex to select points when t > 120s. This has resulted
in a much higher hit rate at finding performance tests in MMP
data (almost 99% of the time).
.. As part of a series of commits to add Banister IR modeling
this first one introduces a Power Index metric that can be
used to normalise TTEs of a different duration to a single
score.
.. This is so we can use performance tests of differing durations
when fitting Banister model curves to estimate k1 and k2.
.. The average power for an interval/ride is compared directly
with a power estimate for the same duration using the Morton
3-parameter model and mean values derived using opendata (where
CP=261, W'=15.5kJ and Pmax=1100w)
.. For the equivalence to be valid test must be in the 2-20 minute
range when used in banister modeling, but the index value is
valid as a comparison to the average athlete for all durations.