Hi.
I want to find the zero root of one single equation. I know how to find roots for a system of nonlinear equations. I also know the mm_root() function. But in my case, this function returns just a missing value. My code is as follows:
So the problem seems to be that the functions evaluates to missing at some point in the algorithm. Solving the same equation in Matlab or Julia works fine, but I need to use stata here.
So I end up with two questions:
1) Did I do something wrong when applying the mm_root() function?
2) Are there any alternatives?
Thank you for your help!
I want to find the zero root of one single equation. I know how to find roots for a system of nonlinear equations. I also know the mm_root() function. But in my case, this function returns just a missing value. My code is as follows:
Code:
mata mata clear function myfunc(n, k1, t1, t3, p) return(-k1+ (n/(1-p))*(((1-t1)*k1/n)^(1-p))-n*((1-t3)^(1/p-1))*(p/(1-p))) k1 = 52000 t1 = 0.07 t3 = 0.5 p=1/(0.8+1) mm_root(n=., &myfunc(), 0, 1000000, 0, 1000, k1, t1, t3, p) n end
So I end up with two questions:
1) Did I do something wrong when applying the mm_root() function?
2) Are there any alternatives?
Thank you for your help!
Comment