2
$\begingroup$

With reference to the original thread on Stackexchange, my question is as follows.

Usually, one would enter two value-series and a script or program calculates the correlation. For instance, with $x = 5,3,6,7,4,2,9,5$ and $y = 4,3,4,8,3,2,10,5$, the correlation is $0.93439982209434$.

For an educational website, I'm trying to find a way to let students:

  • put in value series $x$, eg. $x = 5,3,6,7,4,2,9,5$
  • put in the correlation, eg. $0.9344$
  • put in upper and lower boundaries of $y$-series, eg. between $1$ and $10$
  • give back a random series which fits the citeria, eg. $y = 4,3,4,8,3,2,10,5$

The PHP script I have written to calculate the correlation can be found in the referred-to post on stackexchange. However, it was suggested mine was much more a mathematical than a programmatical question, hence this post. Would it be possible to execute this "reverse correlation"?

  • 0
    If you restrict to integers between bounds, then there is no guarantee that there is a sequence that gives the exact correlation entered.2012-05-15
  • 0
    But without bounds, the returned sequence matching [1,2,3] could be as large as [10000,20000,30000], for instance. I believe the educational purpose would be somewhat lost there. The boundaries would be there to return a sequence af approximately the same order of magnitude as the given sequence. Would it be feasible to, within bounderies, return an approximation of the correlation given? In other words, if the returned sequence would correlate not to 0.9344 but 0.899, then that would also be acceptable. Perhaps a plus/minus 10% boundary could be set?2012-05-15
  • 0
    do you restrict to integers values? not only that makes your problem more artificial/difficult, but I also consider it potentially misleading from an educational POV2012-05-15
  • 0
    Although I can see how you got that from the OP, I do not restrict to integer values.2012-05-15

1 Answers 1