Timeline for Estimating the number of tanks based on a sample of serial numbers 2.0
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 13, 2017 at 1:40 | comment | added | Oscar Smith |
That won't work because my code relies on generating different max values for each row. So the first row is in 1:5 , the second is in 1:6 for example.
|
|
Dec 13, 2017 at 1:23 | comment | added | mkrieger1 | I don't yet understand how it works, but see here or here. | |
Dec 13, 2017 at 1:13 | comment | added | Oscar Smith |
How can I replace these two lines to pick without replacement maxes = np.broadcast_to(np.arange(start+1, end+1), (numCapturedTanks, 100, end - start)) tankSerialNumbersSimulated = np.floor(np.random.uniform(1, maxes))
|
|
Dec 13, 2017 at 1:12 | comment | added | mkrieger1 |
Then I seem to not quite understand what you're proposing. Anyway, the "offending" line tankSerialNumbers = np.random.randint(1, chosenNum + 1, size=numCapturedTanks) is outside the createListOfStandardDeviations function.
|
|
Dec 13, 2017 at 1:04 | comment | added | Oscar Smith |
It is complicated because np.random.choice does not let you generate a 3d array where each element has a different maximum as I did in my version of createListOfStandardDeviations . This ability to vectorize led to much of the speed boost my solution provided.
|
|
Dec 13, 2017 at 0:57 | comment | added | mkrieger1 |
I don't see how my version makes vectorization any more or less difficult than the original version and how it should affect createListOfStandardDeviations . In both cases you get a 1-dimensional array tankSerialNumbers , only in my versions the numbers are guaranteed to be unique
|
|
Dec 13, 2017 at 0:01 | comment | added | Oscar Smith |
That's really annoying, as it makes vectorization way more difficult. Is there a way to make my version of createListOfStandardDeviations vectorized, fast, and correct?
|
|
Dec 12, 2017 at 15:01 | history | answered | mkrieger1 | CC BY-SA 3.0 |