Open drserajames opened 5 years ago
This is clearly for Racmacs. If you think it's a bug (or misfeature) in acmacs.r please provide the code that uses acmacs.r calls only.
But there is a problem with the map resolution test implementation. I don't understand the algorithm, mostly because I am not good in statistics. What I had to do was reverse engineer a (quite cryptic) lispmds code and tried to do the same in acmacs. It would be perhaps good to re-implement the map resolution test using clearly described algorithm, preferably split into few parts with ability to test each part separately.
There is a strange thing in your code above. dist matrix has few negative values. What is the purpose of generating table using so complicated way? Why not just make a matrix with random titers directly, e.g. matrix(10*2^(sample.int(10,size=100,replace=TRUE)-1), nrow=10, ncol=10)
Also I think map resolution test should be (first) implemented in R, e.g. by Sam, and use acmacs just to relax maps. Then at least we would be confident that statistics is done correctly and you will be able to test your CI assumptions knowing that there are unlikely any mistakes in statistics code inside the test.
That's a good idea to implement in R first. I will talk to Sam about it.
My odd process for generating random data was to create a distance matrix that represents a 2d map with added noise, rather than completely random data. The noise made some distances negative, so I should have added a line to force those to zero. It's definitely not the most concise way of doing it.
I had originally submitted this to Racmacs, but I realised that the dimensionTestMap function uses acmacs.map_resolution_test
I'm not sure if this is an error or if I'm interpreting the data incorrectly. There is more variability in the average absolute error than I'd expect from it's sd and n.
I used the sd and n to calculate a 95% CI = mean +/- 1.96 * sd / sqrt(n) . I then repeat dimension testing and compare the results. With 5 dimensions and 10 repeats (50 data points), I'd expect 2.5 to be outside the CIs. Most are outside this range.
Example code below
The attached plot show the first dimension test (black) with 95% CI and the subsequent 10 repeats (coloured)