add_linear_terms: Add linear terms to another function. Allows you to easily change an existing function to include linear terms.
add_linear_terms(func, coeffs)
Function with added linear terms
Function to add linear terms to
Linear coefficients, should have same length as function has dimensions
banana(c(.1,.2)) add_linear_terms(banana, coeffs=c(10,1000))(c(.1,.2))
Run the code above in your browser using DataLab