JPEG is said to be a lossy quality image format so most people prefer PNG. When JPEGs are edited it seems the quality does degrade(it's demonstrated well in the documentation of GIMP). How can we calculate what is the rate of loss or is there any measure to determine the amount of loss with respect to the number of edits made?
It is not said, It is. :o)
And it is not that most people prefer PNG. Normally PNG is for some things like graphs and logos where you have plain colors to be viewed on screen.
JPG is an output format for photos, either on screen or for print. Notice the term output format, versus working format.
If you are editing several times a photo use an internal format, PSD for Photoshop, CPT for PhotoPaint, XCF for Gimp.
After that you generate an output file. Generate as many output files as you need.
Regarding your question there is no way to know the degradation, becouse people can simply play with the compression settings.
If you save 2 times the same picture with no editing with the exactly same settings, the first time will have more degradation than the second time, becouse the sampling is already done.*
Besides that, there are some variations on the compression algorithms themselves. 4:2:2, 4:4:4, etc.
If you edit something some parts must be analyzed and compressed again. So there is no way to know that.
*One note. If you are working on a file, and you do not close it you can keep working on the jpg file and save it many times.