Brief introduction, I have multiple data file that can be fitted by models based in mathematical equations that are a combination (by sum, mutiplication, etc...) of other shorter mathematical equations.
As an example I have three short equations:
expression1 <- exp(x)
expression2 <- exp(x^2)
expression3 <- exp(1/x)
Because each data file has it's own bigger expression that produce a better fit, I want to be able to generate these larger expressions as a combitaion of the shorter expressions.
What I want is to be able to write something like this:
expression1(1) + expression1(2) * expression2(3) + expression2(1)
And get:
x1 + x2 * x3^2 + 1/x1
Later I will use this larger equations to find the values x1, x2, x3 that better fits one data file.