Is there an R function or package for finding the gradient and Hessian of a vectorized equation?

后端 未结 0 451
忘掉有多难
忘掉有多难 2020-12-22 02:05

For example if I want to find the gradient and Hessian with respect to x of:

f = function(x,y,alpha,A,b){
  return((1/n)*(y-alpha*x)%*%(y-alpha*x) + (A%*%x-b)         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题