Function in function in R -
I have a question I want to write (for example) function (in R):
Fun = function (x) {g = x [1]; Z = x [2]; D = X [3] fun = 2G + 1 + 3z * F (d)}
Where is the function of F (D) D. After this I will use the optim function to optimize the parameters (G, Z, D). How do I write this function?
Assume that 2 * g + 1 + 3 * z * f (d) / Code> is
funny
and it is defined as F
, you can only define the initial criteria for optim
Fun & lieutenant; - Function (x) {g & lt; -x [1]; Jade's & lt; -x [2]; D & LT; -x [3]; 2 * g + 1 + 3 * z * F (d)} optim (c (1, 1, 1), funny)
Reference:
Comments
Post a Comment