I am trying to repair a list of supposedly monotonically and smoothly ascending numbers, like a CDF. An example would be like
aa={1,2,3,4,5,100,200,300,400,500,30,31,32,33,34,35};
bb=Differences[aa]
The objective is to scale up the first five elements to synch up with the sixth which is 100, and then to scale down the first ten elements to bring the first ten elements of the revised list to line up with the remaining six elements.
I have tried the following
MapThread[If[#1>90||#1<-10,MapThread[ReplacePart[aa,#2*Position[bb,#1+1]/Position[bb,#1]]&,{aa[[1;;Position[bb,#2]]]}]&,{bb}]
Apparently, #1 for the first MapThread and #2 for the second MapThread were not executed as intended. Any suggestions or corrections will be much appreciated.
MapThread
... Also, please add the list result you want. There may be an easier way to solve the problem. $\endgroup$