typos
This commit is contained in:
@@ -739,7 +739,7 @@ To go from a function that takes a point to a function of that point, we have th
|
||||
|
||||
```{julia}
|
||||
#| eval: false
|
||||
FowardDiff.gradient(f::Function) = x -> ForwardDiff.gradient(f, x)
|
||||
ForwardDiff.gradient(f::Function) = x -> ForwardDiff.gradient(f, x)
|
||||
```
|
||||
|
||||
It works as follows, where a vector of values is passed in for the point in question:
|
||||
@@ -781,7 +781,7 @@ partial_x(f, y) = x -> ForwardDiff.derivative(u -> f(u,y), x)
|
||||
|
||||
:::{.callout-note}
|
||||
## Note
|
||||
For vector-valued functions, we can overide the syntax `'` using `Base.adjoint`, as `'` is treated as a postfix operator in `Julia` for the `adjoint` operation. The symbol `\\nabla` is also available in `Julia`, but it is not an operator, so can't be used as mathematically written `∇f` (this could be used as a name though). In `CalculusWithJulia` a definition is made so essentially `∇(f) = x -> ForwardDiff.gradient(f, x)`. It does require parentheses to be called, as in `∇(f)`.
|
||||
For vector-valued functions, we can override the syntax `'` using `Base.adjoint`, as `'` is treated as a postfix operator in `Julia` for the `adjoint` operation. The symbol `\\nabla` is also available in `Julia`, but it is not an operator, so can't be used as mathematically written `∇f` (this could be used as a name though). In `CalculusWithJulia` a definition is made so essentially `∇(f) = x -> ForwardDiff.gradient(f, x)`. It does require parentheses to be called, as in `∇(f)`.
|
||||
|
||||
:::
|
||||
|
||||
@@ -1471,7 +1471,7 @@ We see that `diff(ex, x, y)` and `diff(ex, y, x)` are identical. This is not a c
|
||||
|
||||
|
||||
|
||||
For higher order mixed partials, something similar to Schwarz's theorem still holds. Say $f:R^n \rightarrow R$ is $C^k$ if $f$ is continuous and all partial derivatives of order $j \leq k$ are continous. If $f$ is $C^k$, and $k=k_1+k_2+\cdots+k_n$ ($k_i \geq 0$) then
|
||||
For higher order mixed partials, something similar to Schwarz's theorem still holds. Say $f:R^n \rightarrow R$ is $C^k$ if $f$ is continuous and all partial derivatives of order $j \leq k$ are continuous. If $f$ is $C^k$, and $k=k_1+k_2+\cdots+k_n$ ($k_i \geq 0$) then
|
||||
|
||||
|
||||
$$
|
||||
@@ -1507,7 +1507,7 @@ hessian(ex, (x, y))
|
||||
When the mixed partials are continuous, this will be a symmetric matrix. The Hessian matrix plays the role of the second derivative in the multivariate Taylor theorem.
|
||||
|
||||
|
||||
For numeric use, `FowardDiff` has a `hessian` function. It expects a scalar function and a point and returns the Hessian matrix. We have for $f(x,y) = e^x\cos(y)$ at the point $(1,2)$, the Hessian matrix is:
|
||||
For numeric use, `ForwardDiff` has a `hessian` function. It expects a scalar function and a point and returns the Hessian matrix. We have for $f(x,y) = e^x\cos(y)$ at the point $(1,2)$, the Hessian matrix is:
|
||||
|
||||
|
||||
```{julia}
|
||||
|
||||
Reference in New Issue
Block a user