PeriodicProgrammer
Reputation
542
Next privilege 1,000 Rep.
 Feb 4 awarded Commentator Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values additionally, it does not cover cases of a lot of zeros. so far: {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} returns too much lists with zero. probably one has to just remove all lists where Count[zeros]=length resultlist. Edit: It Just occurs for len=maxZeros (and len= 0 &]? I'm stuck here at the momens :s.. thanks a lot! Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values The Result looks correct, the random selection considers all possible list? I will find it out but I have to retrace the code (which will take a moment :P). Thank you a lot for your support!! Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values @J.M. getSamples[data, fixlen, maxzero, n]; getsamples[testsample, 4,1]: Leads to: {3, 1, 0, 5} {1, 0, 5, 5} {0, 5, 5, 1} {5, 5, 1, 2} … {4, 1, 4, 3} {1, 4, 3, 0} {0, 4, 1, 4} This is needed because: I need to (mostly) unbiased draw a random set of 1 year data (thus I will afterwards randomly select 1 valid list, if the experiment contains one). Dublicates needed as every resulting list is subject to another time frame. Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values @ heike: the length is fixed to 251 data point, this corresponds to 1 event day + 250 workdays, thus 1 year. An adaption of your solution would be to generate sublist of every resultlist > 250 days, but because I'm working with a lot of data this might not be the fastest version. Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values unfortunately its true that this only gives me list with no zeros. But i have a limit of 10 zeroes because 1 missing element would make a lot of experiments useless, even though they are of good quality, see Heike's ansatz.. Feb 4 awarded Supporter Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values thank you a lot for your answer. It's true I cannot use the previous answers as they only generate lists containing no zeros values. But I still have a Issue here: I'm working with time series: Thus I need to have the list {0,2,0,3} {2,5} too, as it correspond to different time data points. I will try to look trough the code, any Idea how to adjust? The Idea Behind: I will only need to Randomly pick 1 list of at least 250, but with a random date. Thus to not bias the statistics, I will need to have overlapping lists. Feb 4 comment Check in a series if there exists adjacent values with less than a certain number of missing values thank you both a lot for the answer, as I'm not a very advanced user yet, I will take my time and start to understand the code fully, I'll give feedback when i sucessfully (or not) implemented it ;) Feb 4 asked Check in a series if there exists adjacent values with less than a certain number of missing values Feb 4 comment How to Delete Elements from List1 appearing in List2? yes this is true. I found Complement on google, but I need the result to be unsorted. Feb 4 comment How to Delete Elements from List1 appearing in List2? thank you a lot, I do have V.8 and it works perfectly! Thank you for the fast answer! Feb 4 awarded Student Feb 4 awarded Editor Feb 4 revised How to Delete Elements from List1 appearing in List2? added 22 characters in body Feb 4 asked How to Delete Elements from List1 appearing in List2?