Normal/Gaussian Function or Method: Normal Probability Density

Normal/Gaussian Function or Method: Normal Probability Density - Mensajes

#1 Publicado: 6/1/2023 19:08:49
Mark R Harris

Mark R Harris

5 me gusta en 90 mensajes.

Grupo: User

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:
Normal PDF.png
Random to Normal.sm (42,72 KiB) descargado 1307 vez(es).

Any thoughts?
#2 Publicado: 6/1/2023 22:47:00
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

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.

#3 Publicado: 7/1/2023 2:07:39
Mark R Harris

Mark R Harris

5 me gusta en 90 mensajes.

Grupo: User

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.
#4 Publicado: 7/1/2023 4:13:06
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

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

Clipboard01.png

so, I guess that in your function rmat this is the function for normal distributed numbers

Clipboard02.png

random to nomral.sm (5,54 KiB) descargado 1343 vez(es).

Best regards.
Alvaro.
A 1 usuarios les gustó este mensaje
Mark R Harris 7/1/2023 5:25:00
#5 Publicado: 7/1/2023 5:32:57
Mark R Harris

Mark R Harris

5 me gusta en 90 mensajes.

Grupo: User

Thanks Alvaro, very greatly appreciated.

For me, the sample file has a problem:
Syntax Error.png
#6 Publicado: 7/1/2023 5:55:38
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

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.
A 1 usuarios les gustó este mensaje
Mark R Harris 7/1/2023 6:22:00
#7 Publicado: 7/1/2023 11:22:38
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

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.

sigma.PNG

Random NORMAL Histogram Copy.sm (44,16 KiB) descargado 1280 vez(es).

#8 Publicado: 7/1/2023 15:44:13
Mark R Harris

Mark R Harris

5 me gusta en 90 mensajes.

Grupo: User

Thank you both. Alvaro: perfect, thank you.

Here is the working update:

20230109 Random Normal Distribution.png

20230109 Random to Normal.sm (54,5 KiB) descargado 1371 vez(es).
#9 Publicado: 9/1/2023 1:41:49
Mark R Harris

Mark R Harris

5 me gusta en 90 mensajes.

Grupo: User

See the updated post above.
#10 Publicado: 9/1/2023 12:44:09
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

See the updated post above.



20230109 Random to Normal_1.sm (81,83 KiB) descargado 1324 vez(es).

  • Nuevos mensajes
  • Sin mensajes nuevos