phetsims / projectile-data-lab

"Projectile Data Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 0 forks source link

Standard deviation value in the sim may not be correct #155

Closed catherinecarter closed 7 months ago

catherinecarter commented 7 months ago

I was playing with the sim embedded in CODAP and noticed that the value of the standard deviation sometimes differs from the SD calculated in CODAP. Here's an example where the sim gives 8.09 as the SD but CODAP calculated 8.24:

image

Let's make sure the SD in the sim is calculating this value correctly.

samreid commented 7 months ago

I'm not sure how to read the standard deviation in CODAP, so I exported the CODAP data to excel, and also saw a difference:

image

samreid commented 7 months ago

Excel is showing STDEV.S and we are computing STDEV.P. When I compute STDEV.P in Excel, it matches our value.

samreid commented 7 months ago

Is codap showing the sample standard deviation or population standard deviation?

catherinecarter commented 7 months ago

CODAP is using stdev.s, which means it's calculating the SD from a sample. The stdev.p is for the population. The difference is the denominator. The formulas are:

Since the projectiles on the field are considered (I think?) to be a sample from the infinite population of the cannon, we need to use stdev.s, or the sample standard deviation (the .s = sample; .p = population).

For reference, the population standard deviation is the set value embedded into each cannon, although these are set as speed and angle SDs, but each impacts the true population standard deviation of the landing positions.

Does that help build clarity?

matthew-blackman commented 7 months ago

The fix was erroneously committed to https://github.com/phetsims/projectile-data-lab/issues/156. My fault! The good news is that everything is behaving perfectly here now. Nice work! Closing.