SMath Studio Forum
»
SMath Studio
»
Questions
»
Normal/Gaussian Function or Method: Normal Probability Density
Rank: Advanced Member Groups: Registered
Joined: 01/04/2020(UTC) Posts: 85 Location: Wellington Was thanked: 4 time(s) in 3 post(s)
|
This matrix generator (thanks gUrrozEN) produces random 'equal-probability' values for a given center value and tolerance band. I'm hoping to revise this to return values within a normal/Gaussian probability as illustrated: Random to Normal.sm (43kb) downloaded 3 time(s).Any thoughts? Edited by user 07 January 2023 03:37:44(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: marks2c Any thoughts ? Native Smath plugins generate uniform randoms. The Central Theorem proves that enough uniform randoms generate a Normal Distribution. You simply need to bin in an histogram utility. Is that is what you are looking for ? Otherwise, I don't understand your request. Cheers ... Jean.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 01/04/2020(UTC) Posts: 85 Location: Wellington Was thanked: 4 time(s) in 3 post(s)
|
Thank you for the reply Jean. I'm after a method or function that will return a random value with the probability that 68.2% of the time it will be within 1 sigma, and 95.4% of the time it will be within 2 sigmas, etc. Edited by user 07 January 2023 11:35:10(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi. For 'convert' random uniform distributed numbers between 0 and 1 to another probability distribution, in your case, for get some normal distributed numbers you can use the inverses of the cdf distributions. You can check that here for 1000 numbers you have the desired mean and std deviation so, I guess that in your function rmat this is the function for normal distributed numbers random to nomral.sm (6kb) downloaded 8 time(s).Best regards. Alvaro.
|
1 user thanked Razonar for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 01/04/2020(UTC) Posts: 85 Location: Wellington Was thanked: 4 time(s) in 3 post(s)
|
Thanks Alvaro, very greatly appreciated. For me, the sample file has a problem:
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi. I mean: substitute that M[i,j] into your rmat(...) function for get normal distributed numbers with the rmat algorithm instad uniform distributed ones.
Best regards. Alvaro.
|
1 user thanked Razonar for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: marks2c Thank you for the reply Jean.
I'm after a method or function that will return a random value with the probability that 68.2% of the time it will be within 1 sigma, and 95.4% of the time it will be within 2 sigmas, etc. I don't understand completely ... sorry. However, from a native random sigma, you can solve for a desired other one. Cheers, be good Down Under ... Jean. Random NORMAL Histogram Copy.sm (45kb) downloaded 3 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 01/04/2020(UTC) Posts: 85 Location: Wellington Was thanked: 4 time(s) in 3 post(s)
|
Thank you both. Alvaro: perfect, thank you. Here is the working update: 20230109 Random to Normal.sm (55kb) downloaded 8 time(s).Edited by user 09 January 2023 06:48:25(UTC)
| Reason: Updated with the finished item.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 01/04/2020(UTC) Posts: 85 Location: Wellington Was thanked: 4 time(s) in 3 post(s)
|
See the updated post above.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Normal/Gaussian Function or Method: Normal Probability Density
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.