       Re: Mixed Numerical Derivatives

• To: mathgroup at smc.vnet.net
• Subject: [mg87176] Re: Mixed Numerical Derivatives
• From: Andrew Moylan <andrew.j.moylan at gmail.com>
• Date: Thu, 3 Apr 2008 05:15:25 -0500 (EST)
• References: <fsveco\$sp7\$1@smc.vnet.net>

```On Apr 2, 6:59 pm, "jwmerr... at gmail.com" <jwmerr... 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:=
> D[x^3 + z*y^-1 + z^(1/2), {{x, y, z}, 2}] /. {x -> 3, y -> 5,
>   z -> 12}
>
> Out= {{18, 0, 0}, {0, 24/
>   125, -1/25}, {0, -1/25, -1/(96 Sqrt)}}
>
> The function I'm interested in, though, can only be calculated
> numerically.  Using ND, I can find the diagonal elements of the
> Hessian:
>
> In:= rules = Last[
>   FindMaximum[{Total[logPr[vdt, ddt, var, #] & /@ testData], ddt > 0,
>     var > 0}, {{vdt, .9}, {ddt, 120}, {var, 90}}]]
>
> Out= {vdt -> 0.95945, ddt -> 151.097, var -> 103.255}
>
> In:= Needs["NumericalCalculus`"]
>
> In:= ND[
>  Total[logPr[vdtp, ddt, var, #] & /@ testData] /. rules, {vdtp, 2},
>  Evaluate[vdt /. rules]]
>
> Out= -64.4011
>
> But what about the off diagonal elements?

If you'll need to evaluate the derivatives of the function many times,
try setting up a FunctionInterpolation. You can use D on that.

```

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