David
Noting that
Toe100 =: 100 * Toe^Heel
>.(Series^Heel) % Toe100
1 1 1 1 1 2 2 3 5 6 9 12 15 20 27 35 45 57 72 90 112 139 171 208 253
it is apparent you're scaling the input raised
to some power.
This is easy to do and your implementation
seems ok, given your values, so what do you need an
opinion on? How better to express it in J, or how
better to do "adjustable progression" in general?
Or do you need ideas on how to choose values for
Toe & Heel?
If the last then this might do:
NB. Assuming "adjustable progression" is an
NB. expression
NB. output =: (input item^power) * scale
NB. ToeHeel derives the parameters by solving the
NB. simultaneous linear equation so that the 1st
NB. and last elements map to 1 and 250
NB. (you might prefer to average the first/last few items)
NB. Assuming input is in ascending order.
ToeHeel =: ((^.1 250) %. ])@(1,.^.)@({.,{:)
NB. AdjProg solves ToeHeel and applies the coeffs
AdjProg =: ToeHeel (>.@ ^ @ +/ . *)~(1,.^.)
AdjProg Series
1 2 3 4 5 7 9 11 15 19 23 29 36 43 52 63 75 89 105 122 143 165 191 219 250
Evidently the "toe" of my results is not as "flat" as
in your example, so perhaps the {. should be replaced
by a later element.
eg
NB. Dyadic versions - left arg is start index for ToeHeelDy
ToeHeelDy =: ((^.1 250) %. ])@(1,.^.)@({,{:@])
AdjProgDy =: (ToeHeelD (>.@ ^ @ +/ . *)~(1,.^.)@])
0 5 10 AdjProgD"0 1 Series
1 2 3 4 5 7 9 11 15 19 23 29 36 43 52 63 75 89 105 122 143 165 191 219 250
1 1 1 1 1 1 2 3 4 5 7 10 14 18 24 32 41 53 68 86 108 135 167 205 250
1 1 1 1 1 1 1 1 1 1 1 2 3 5 7 11 16 23 34 48 68 96 134 184 250
This seems rather arbitrary and you might require
some heuristic to decide the issue. I think that
should depend on the application domain.
Does this help?
Mike
David Vincent-Jones wrote:
I am working on a project that uses an adjustable progression system from 1
to approximately 250.
Generally the 'toe' of the system is fairly flat but the toe and the heel
need to be independently strengthened or made weaker according with the
specific case.
I hacked the following together originally in Excel but feel it needs a
taste of 'good J' to do it justice
Series=:10+i.25
Toe=: 7.15 NB. control low end
Heel=:6.5 NB. control high end
Prog=: >.100%~(Series%Toe)^Heel
Prog
1 1 1 1 1 2 2 3 5 6 9 12 15 20 27 35 45 57 72 90 112 139 171 208 253
Yes .. I know it is very nasty ;) but it works fairly well!
Some ideas would be appreciated.
Thanks
David
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm