Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algorithm for stochastic convergence #10

Open
bvssvni opened this issue Sep 14, 2016 · 1 comment
Open

Algorithm for stochastic convergence #10

bvssvni opened this issue Sep 14, 2016 · 1 comment

Comments

@bvssvni
Copy link
Contributor

bvssvni commented Sep 14, 2016

I want to study the limit of Gini coefficient over time assuming random transactions. The goal is to approximate the inverse function to support systems designed for a particular Gini index, given some trading volume (amounts and number of transactions) vs number of players. Random transactions can later be used to compare the decision bias of more complex system. The lower limit makes it rather hard to derive the limit mathematically, so I think about running simulations and measure it.

The problem is to get a source of approximate perfect randomness, and an algorithm that converges efficiently but with high numerical accuracy. These two things are interdependent.

Ideally I want a guarantee that doesn't require me to store the sum or use a floating average, since that might accumulate rounding errors. If the random source is biased, I want a method to detect it.

One approach is to treat is the measurement as a spring, which gradually gets stiffer and less sensitive to measurements over time. When it stops changing the last decimal one can say it has "converged to a limit". The rate where it gets stiffer should be low enough to pick the next digit. If the random source is biased, two runs on the same input (except the random source) should yield different limits.

The problem is: I don't know what change in stiffness is sufficient for picking the next digit. If I knew that I could detect bias in the random source at an earlier moment of time.

It might be that a such algorithm is susceptible to rounding errors, but I am not sure.

Another approach is to repeat the spring algorithm in two layers, since the limit of many results also should converge to a limit. Alternatively use average in the second step.

@bvssvni
Copy link
Contributor Author

bvssvni commented Sep 15, 2016

Neither thread_rng or OsRng could reproduce the limit accurately. I have been thinking some about why, and believe that the stiffness should slow down exponentially. This is equivalent to increasing samples exponentially to get higher accuracy.

For now, I think it is best to settle for a goal of 1/1000 accuracy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant