On 1 November 2013 11:06, IZHAK shabsogh <ishaqbaba at yahoo.com> wrote: > below is a code to compute hessian matrix , which i need to generate 29 number of different matrices for example first You may consider using Numerical Derivatives package for that instead, see: http://cran.r-project.org/web/packages/numDeriv/vignettes/Guide.pdf