6 ms·
I used a power series to approximate the radius of a planet to its mass for a webgl space game I'm making [0] where solar systems are randomly generated. I nee
by gnarbarian 9y ago
I used a power series to approximate the radius of a planet to its mass for a webgl space game I'm making [0] where solar systems are randomly generated. I needed something to roughly approximate the size of a planet or star based solely on mass. Using the 8 planets + (sedna & pluto) and our star to generate the curve function I got a r^2 value of 0.989. [1]
I'm not about to make some scientific claim based on it but for my purpose (a neat game) using a power series to approximate mass was an extremely efficient and simple solution to my problem.
[0] http://thedagda.co:9000/ http://thedagda.co:9000/
edit: if you have an xbox controller you can use this: http://thedagda.co:9000/?gamepad=true http://thedagda.co:9000/?gamepad=true
[1] https://docs.google.com/spreadsheets/d/1GKPNNMJrZMaf8aQqgGD-9DNJMkYVO7BKJvAIQL9o5aI/edit?usp=sharing https://docs.google.com/spreadsheets/d/1GKPNNMJrZMaf8aQqgGD-...
- jmalicki 9y agoPower series and power law distributions are completely different things
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- contravariant 9y agoYeah that's a power law. It would have been pretty easy to see had you used a log-log plot.
- deleted 9y ago[deleted]
- gnarbarian 9y agoThanks for the tip! That looks much better.
- EtDybNuvCu 9y agoThis is literally what the article is arguing against doing.
- gnarbarian 9y agoWell you're right, but that doesn't change the r^2 value or the curve function. Not trying to do science here.
- contravariant 9y agoThey're cautioning against drawing statistical conclusions from it. That doesn't mean the log-log plot isn't more useful than the linear plot. Also they seem to be talking about a power law distribution, whereas here we're talking about the dependence of two variables. As a first step plotting them on a log-log plot and saying 'yeah, looks straight' is fine. Among other things this tells us the dependence is suspiciously close to a cubic root law, which could possibly be justified using dimensional analysis.
- SAI_Peregrinus 9y agoMar's Law: "Everything is linear [power law] if plotted log-log with a fat magic marker".
- wenc 9y agoI'm not seeing the relevance of this to the article? Perhaps you have conflated "power-series" with "power-law"? I'm sure there are merits to your comment, but I don't think it should be the top-voted comment on a subject that is completely different from what you're commenting about.
- gnarbarian 9y agoIt's at least tangentially relevant. I naively took some data and threw some curve fits at it until I had a function that reasonably matched reality for the observed data. When I set the axi to log/log I get a straight line, which is his first point.
- deleted 9y ago[deleted]
- wenc 9y agoThe article is talking about power law probability distributions [0]. What you seem to be doing is fitting a curve with a term that has an exponent, which is a power-law relationship. That is not what the article is talking about, unless you're claiming the residuals of your fit follow a power law distribution. I'm not blaming you for latching on the the term "power-law" -- it's a simple enough mistake -- but HN upvoters should recognize that this is not what the article is talking about at all. [0] https://en.wikipedia.org/wiki/Power_law#Power-law_probability_distributions https://en.wikipedia.org/wiki/Power_law#Power-law_probabilit...
- titzer 9y agoIf you are thinking of using a log-log plot to demonstrate something, please don't. Log-log plots are extremely deceptive. All polynomials (even x^99) are straight lines on a log-log plot. http://www.cs.utsa.edu/~cs1173/experiments/Experiment2LogarithmicScales/Experiment2LogarithmicScales.html http://www.cs.utsa.edu/~cs1173/experiments/Experiment2Logari...
- gnarbarian 9y ago