Problems with evaluation and display of the Normal law

22 views
Skip to first unread message

Cyrille Piatecki

unread,
Jan 6, 2025, 9:41:57 AMJan 6
to JSXGraph
I now have the following problems associeted with the joigned file.

1) if you move the yellow glider you will see a desincronization between the dash line and the integral. This will not arrive if I use inequality instead of integral and an other inequality on a constant 0 line to cover the part under the 0 line.
2) there are two evaluations of the P(X<= a). But they do not give the same result up to the third decimal. It could be anecdotic but here it is a probability problem : third decimal could not be neglected. I do not know which is the more legitimate. If you have choosen an evaluation inside the command could we know what is its support ?
3) on the left of the 0 line there is a point that should be not visible. I was supposing that it was given by baseLeft. But I cannot render it to invisible.
4) A sugggestion. The repartition function of the normal law is documented in statistics but not it's density perhaps it could be a nice idea to add it (with choice of  expectation and variance) as a new function. Later I will try other distributions. 

General Reflexion : I think that JSXgraph could be a great tool to teach probability, statistics and econometrics and finance.

densitenormale.html

Tom Berend

unread,
Jan 6, 2025, 5:05:56 PMJan 6
to jsxg...@googlegroups.com
Dear Cyrille,

Quick fix for the easy one:  #3
image.png
 I
For #2, one of your evaluations is your exact phi calculation of the glider(s) .X() location, the other is the numerical integration of the same value using NewtonCotes.   I'm not a math guy, but it's amazing to me that they are as close as they are.  Your syntax was slightly incorrect, see example is below.  If you need more accuracy from the numerical interation, perhaps reduce the step size by increasing the number of nodes.   Default is 28, I tried 64 and seems more accurate.

image.png

Regards
Tom


--
You received this message because you are subscribed to the Google Groups "JSXGraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsxgraph+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jsxgraph/0e69b0f0-b247-4de3-aff0-fe8427ef65e6n%40googlegroups.com.

Alfred Wassermann

unread,
Jan 8, 2025, 3:40:52 AMJan 8
to JSXGraph
Dear Cyrille,

thank you very much for this interesting example.

1) At the time being, the update of the filled integral area happens before the update of the integral bounds. Thus, the filled area appears to "lag behind". I'll try to fix that soon. Thanks for pointing it out.
2) The difference between the two evaluations of P(X <= a) stems from different integration intervals. In the call of NewtonCotes you used a different left bound then in create('integral'). In https://jsfiddle.net/vLdp4aqy/1/ you'll find a corrected version of your example that uses the variable `left` as the common left integration bound. Then the two evaluations coincide to much more digits, although the integral element uses JSXGraph.Math.Numerics.qag for the evaluation.
3) See Tom's answer
4) Can you please explain this in detail? It seems that Wigand Rathmann has done something similar (https://wrathmann.github.io/)

Best wishes,
Alfred

Alfred Wassermann

unread,
Jan 8, 2025, 4:14:10 AMJan 8
to JSXGraph
A short update:

1) is fixed now in the branch develop and will be included in the next release.
2) For this probability function, the two integral evaluations coincide on 15 digits.

Best wishes,
Alfred



Cyrille Piatecki

unread,
Jan 11, 2025, 3:35:17 PMJan 11
to JSXGraph
As I told you I think that jsxgraph has many capacities. Particularly it could be a nice support for statistics, time series and econometrics. The presence of the most usual continuous density function should be a great tool. In SPGoo, we have open a jsxgraph section for mathematics, with subsections in geometrics, statistics and analysis. Mainly some visual theorems. I plan also to use it in game theory and why not in simulation. I am searching some collaboration with physicist to find some application and collaboration. I will see an astrophysicist.
Reply all
Reply to author
Forward
0 new messages