MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mixed Numerical Derivatives

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87159] Re: Mixed Numerical Derivatives
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 2 Apr 2008 05:58:00 -0500 (EST)
  • References: <fsveco$sp7$1@smc.vnet.net>


Hi,

I have version 6 and can not find ND.

Nevertheless, you could try an iterative approach. E.g.:

ND[ ND[fun[x,y],{x,2},1] ,{y,2}, 1]

hope this helps, Daniel



jwmerrill at gmail.com wrote:

> How can I come up with the Hessian of a function, at a particular

> point, which can only be evaluated numerically?  If I had a symbolic

> function, I could do something like

> 

> In[123]:=

> D[x^3 + z*y^-1 + z^(1/2), {{x, y, z}, 2}] /. {x -> 3, y -> 5,

>   z -> 12}

> 

> Out[123]= {{18, 0, 0}, {0, 24/

>   125, -1/25}, {0, -1/25, -1/(96 Sqrt[3])}}

> 

> The function I'm interested in, though, can only be calculated

> numerically.  Using ND, I can find the diagonal elements of the

> Hessian:

> 

> In[92]:= rules = Last[

>   FindMaximum[{Total[logPr[vdt, ddt, var, #] & /@ testData], ddt > 0,

>     var > 0}, {{vdt, .9}, {ddt, 120}, {var, 90}}]]

> 

> Out[92]= {vdt -> 0.95945, ddt -> 151.097, var -> 103.255}

> 

> In[111]:= Needs["NumericalCalculus`"]

> 

> In[124]:= ND[

>  Total[logPr[vdtp, ddt, var, #] & /@ testData] /. rules, {vdtp, 2},

>  Evaluate[vdt /. rules]]

> 

> Out[124]= -64.4011

> 

> But what about the off diagonal elements?

> 




  • Prev by Date: Re: How to put text on a curved surface?
  • Next by Date: Re: setting elements of an array based on a condition
  • Previous by thread: Re: How to put text on a curved surface?
  • Next by thread: Re: Mixed Numerical Derivatives