JuliaMath / JuliaMath/Calculus.jl
analytic Jacobian
- Dominant language
- Julia
- Stars
- 285
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
i wrote counterparts to the existing `finite_difference_jacobian` for the case where the function of interest is analytically differentiable. happy to submit a PR if there is interest. would just need to know the best place to put it.
```
function analytic_jacobian{T<:Number}(fdot::Vector{Function}, x::Vector{T})
f_x = fdot[1](x)
J = Array(Float64,length(f_x),length(x))
J[:,1] = f_x
for i = 2:length(fdot)
J[:,i] = fdot[i](x)
end
J
end
"""
`jacobian(fdot::Vector{Function}) -> g(x::Vector)`
Given a function `f` whose partial derivatives are `fdot`, return a function
`g(x)` which itself returns the Jacobian of `f` at `x`.
"""
function jacobian(fdot::Vector{Function})
g(x::Vector) = analytic_jacobian(fdot, x)
return g
end
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.