Open julianesiebourg opened 4 months ago
It seems that for euklidean distances (p = 2) higher distances are influencing the score more than smaller distances. In the extreme case this leads to the formation of clusters in the opposite corners of a plate. Since clusters are not lines, the line penalization does not help much here. With manatten distance (p = 1) we see this problem less.
Maybe it would be better to go for a adjacency score (parametrized with "order of adjacency" e.g. n=1 direct neighbor, n = 2 second order neighbors). This had been set up by Iakov in the past in an adhoc fashion: https://code.roche.com/PMDA/cross-project/opm/opm-macs-augenklinik-bern/-/blob/main/Olink%20Plate%20Layout/sample_randomization_March21_Iakov.Rmd
The score might also be influenced by how many levels a factor has. e.g. Sex with 2 levels vs a trial with 8 Sites.
A quick and dirty fix just sets the paramters correctly in the optimize_multi_plate_design function is here https://github.com/bedapub/designit/pull/49
optimize_multi_plate_design
does not really optimize within plate distribution of covariates. Instead, clusters form.Replacing the parameters p = 1 and penalize_lines = "none" fixes the issue but these cannot be set in optimize_multi_plate_design
Example