I'm trying to find the real-valued x in (0,1) that solves this polynomial:
\[ Nx^{N-1} - (N-1)x^N = y \] where y is in (0,1) and N is a given integer. I can get solutions using Mata's polyroots function for a given value of y:
But this gives me a bunch of complex solutions that fall outside my desired range. Is there a way to extract a certain restricted value from the solutions vector? I can of course look at the solutions and copy them directly, but I want to run this as part of an ado-file and so need a way to automate the process.
\[ Nx^{N-1} - (N-1)x^N = y \] where y is in (0,1) and N is a given integer. I can get solutions using Mata's polyroots function for a given value of y:
Code:
mata c = -y, rangen(0, 0, N)', N, N-1 polyroots(c) end
Comment