Approximate data of N elements as a sum of products of the target

38 Views Asked by At

Computer Engineer here. I need help with a personal project that is data science related. I am trying to approximate how to solve something like this. Each of these values are a PCA(principle component analysis value). I have dozens of equations in the form of (let's say with 5 variables but I need to be able to solve for 10 or 20 or 30 or 40)-

Target -
0.0694,0.01218,-0.1044,0.0723,-0.0717

A-
0.045529,0.066009,-0.151885,0.002664,-0.125023
B-
0.0785,-0.02538,0.03959,0.186049,-0.068936
C-
0.1253,0.11580,0.05726,0.07892,0.0113
D-
0.10585,-0.06042,0.09748,0.1992,-0.0826
E-
-0.0070176,-0.247268,-0.2299763,0.165638,-0.0353688

I need to be able to solve this in a manner where a possible solution would be (or better/ lower Euclidean distance)-

Solution =
48.4 A
24.6 C
19.0 E
5.8 B
2.2 D

Edit:So here the target is solved as - 48.4*A + 24.6*C + 19.0 *E + 5.8*B + 2.2*D = Target

The solution is at a Euclidean distance of 0.0135 from the target. I know there are solutions using Monte Carlo where they use penalties and cycles. I don't understand Monte Carlo well. Some folks are using machine learning algorithms.

I need help with what kind of algorithm I can use; as well as required reading to understand the math behind this. The aim is to find a better solution than a local minima, hopefully the absolute minima but it needs to something that can be done fairly quickly on a PC (few seconds and not hours).

I haven't been in touch with Math for many years so I am pretty lost. Thanks for reading!