Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm assuming all of your numbers are multiples of <strong>integer</strong> values. For the rest of my explanation, A will denote the "root" frequency you are trying to find and B will be an array of the numbers you have to start with.</p> <p>What you are trying to do is superficially similar to <a href="http://en.wikipedia.org/wiki/Linear_regression" rel="noreferrer">linear regression</a>. You are trying to find a linear model y=mx+b that minimizes the average distance between a linear model and a set of data. In your case, b=0, m is the root frequency, and y represents the given values. The biggest problem is that the independent variables X are not explicitly given. The only thing we know about X is that all of its members must be integers.</p> <p>Your first task is trying to determine these independent variables. The best method I can think of at the moment assumes that the given frequencies have nearly consecutive indexes (<code>x_1=x_0+n</code>). So <code>B_0/B_1=(x_0)/(x_0+n)</code> given a (hopefully) small integer n. You can then take advantage of the fact that <code>x_0 = n/(B_1-B_0)</code>, start with n=1, and keep ratcheting it up until k-rnd(k) is within a certain threshold. After you have x_0 (the initial index), you can approximate the root frequency (<code>A = B_0/x_0</code>). Then you can approximate the other indexes by finding <code>x_n = rnd(B_n/A)</code>. This method is not very robust and will probably fail if the error in the data is large.</p> <p>If you want a better approximation of the root frequency A, you can use linear regression to minimize the error of the linear model now that you have the corresponding dependent variables. The easiest method to do so uses least squares fitting. <a href="http://mathworld.wolfram.com/LeastSquaresFitting.html" rel="noreferrer">Wolfram's Mathworld</a> has a in-depth mathematical treatment of the issue, but a <a href="http://www.physics.csbsju.edu/stats/least_squares.html" rel="noreferrer">fairly simple explanation</a> can be found with some googling.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload