Thanks for the hint, I will have to look at bit closer at this. I can run my function, say phi(), on a vector, say P, and get the proper best response out. But when I try to use ForwardDiff.Jacobian, I get
ERROR: InexactError() in setindex! at array.jl:313 in copy! at abstractarray.jl:307 in phi at none:29 in _calc_jacobian at /home/pkm/.julia/v0.4/ForwardDiff/src/api/jacobian.jl:101 in jacobian at /home/pkm/.julia/v0.4/ForwardDiff/src/api/jacobian.jl:27 This strikes me a kind of weird, since the original method works. Line 29 assigns a vector into a vector of vectors. On Saturday, November 28, 2015 at 7:46:02 PM UTC+1, Kristoffer Carlsson wrote: > > https://github.com/JuliaDiff/ForwardDiff.jl does this. > > I use it all the time to compute jacobians of R^N -> R^N functions (the > jacobian of the residual equations in non linear material modeling). > > On Saturday, November 28, 2015 at 5:41:55 PM UTC+1, Patrick Kofod Mogensen > wrote: >> >> So I have a map from a set of strategies of players to the best response >> of each player given the original strategies (a discrete probability >> distribution for each player). I want to find the jacobian of this mapping, >> because I need to calculate the spectral radius of it. I am using finite >> differences at the moment, but I would like to use automatic >> differentiation. >> >> Is this possible? I can't seem to find a JuliaDiff package that does it. >> Should I just do it for each element of my best-response mapping one at a >> time? So I get N functions from R^N to R ? (really it's from (0,1)^N to >> (0,1), but...) >> >> Best, >> Patrick >> >
