# Correlation based recovery missing elements in a List?

Posted 7 months ago
949 Views
|
7 Replies
|
1 Total Likes
|
 Hi,Is there some easy methods that could be used here for filling missing elements in List A based on elements of List B? List A = { 190.5904, 190.7829, 190.9854, 191.0015, 191.0078, 191.0233, "", "", "", "", "", "", "", "", "", ""}; List B = { 9.4413, 10.2572, 7.8034, 6.7098, 6.3064, 8.1171, 6.618, 6.618, 6.378, 7.944, 7.8, 6.294, 7.356, 6.936, 6.252, 7.344}; Thanks in advance to everyone who respond.
7 Replies
Sort By:
Posted 7 months ago
 How are the two lists related to one another?
Posted 7 months ago
 common elements correlation is high; for example 0.8.
Posted 7 months ago
 there are still too many philosophies to choose fromperhaps say what the data is and why you need the list completion, then which philosophy fits the purpose will be clear
Posted 7 months ago
 Thank you John. I would like to know, is there any simple and unique command for filling gaps in the List 1?
Posted 7 months ago
 Unique? No.Simple? Well, if you pick a model, e.g. linear, then there are various *Fit functions that can construct a model. lm = LinearModelFit[DeleteCases[Transpose@{B, A}, {_, ""}], b, b]; anew = Transpose@{B, A} /. {b_, ""} :> {b, lm@b} // Transpose // Last (* {190.59, 190.783, 190.985, 191.002, 191.008, 191.023, 191.029, 191.029, 191.05, 190.913, 190.925, 191.057, 190.964, 191.001, 191.061, 190.965} *) The result is disappointing on the example data supplied. Below I use the same method to fill in the missing value, but color the new point red: Transpose@{B, A} /. {b_, ""} :> Style[{b, lm@b}, Red] // ListPlot I suppose it's not actual data, since there appears to be no significant relationship between B and A. I would say in this example, there is no reliable way to fill in the missing values.