What is the most efficient way to solve a system of equations containing a dimam function?

What is the most efficient way to solve a system of equations using the digamma function?

I have a vector v, and I want to solve for a vector w such that for all i:

digamma (sum (w)) - digamma (w_i) = v_i

and

w_i> 0

I found the gsl function gsl_sf_psi, which is a digamma function (computed using some kind of series). Is there an identity that I can use to reduce equations? Do I prefer to use a solver? I am using C ++ 0x; which solver is easiest to use and fast?


From my preliminary research, digamma is not easily reversible (reverse digamma searches give algorithms that work in binary searches), so it makes sense that there will be no simplification for the whole system.

Thus, the use of the solver now leaves two problems: the fact is that the digamma is very slowly calculated and deals with the restriction w_i> 0, otherwise the dimam (w_i) will fail for w_i = 0.

For the first problem, I thought that maybe I should implement a cache for the newly calculated digamma values ​​- I thought this would be a good idea, but I don’t know much about how the root search algorithms work.

My idea was to solve the second problem - find w'_i = log (w_i). So w'_i are on the whole line. Interestingly, this is a good idea. There is probably no function to search for digamma (exp (w ')) directly? In addition, the algorithm can take measures in the space w and not improve things, because the mapping from w '-> w loses some accuracy and therefore two elements of w' can be matched with the same w.

, . , .

...

+3
1

, , , , . ​​, , , , , :

, , , , GNU Octave - , , , . , , , ( Octave, Matlab, Mathematica , ), Scilab SageMath, open source/free, ++ ( , )

, .

+1

Source: https://habr.com/ru/post/1740621/


All Articles