square of a number using gaussian distribution

Sandy.Arv

Is there a way to calculate the square of a number (closest approximation), say 4, using Gaussian distribution where mu is the number and sigma is 0.16. and for 1000 random points?

I searched the internet a lot, but couldn't find a solution to this. Any piece of code would be very much helpful as i am new to python.

sve

Assuming that you have your data generated you could find an approximation of your mu (which is the square of your number) by taking the mean of your data. By the law of the large numbers you can be sure that as the size of your data grow the approximation become more accurate. Example:

import random


def generate_data(size):
    mu, sigma = 4 ** 2, 0.16
    return [random.gauss(mu, sigma) for _ in range(size)]


def mean(ls):
    return sum(ls) / len(ls)

print(mean(generate_data(10)))     #15.976644889526114
print(mean(generate_data(100)))    #16.004123848232233
print(mean(generate_data(1000)))   #16.00164187802018
print(mean(generate_data(10000)))  #16.001000022147206

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Variance using Gaussian distribution Python

From Dev

Python: Creating a Gaussian distribution for a variable and running a program on a loop using the Gaussian values

From Dev

Python: Creating a Gaussian distribution for a variable and running a program on a loop using the Gaussian values

From Dev

Fitting an image to Gaussian distribution

From Dev

Multiple Gaussian distribution

From Dev

Dealing with normal (Gaussian) distribution

From Dev

Adding realistic noise to a gaussian distribution while keeping the number of samples above/below a threshold approximately constant

From Dev

Generating a chi-square distribution using goodness of fit test

From Dev

Generating a chi-square distribution using goodness of fit test

From Dev

Strange behaviour with Gaussian random distribution

From Dev

Fail to generate gaussian distribution with seed

From Dev

Gaussian distribution for censored regression with cenreg

From Dev

Inverse of the cumulative gaussian distribution in R

From Dev

Multivariate Gaussian distribution formula implementation

From Dev

Finding the square root of a number by using binary search

From Dev

Draw multivariate Gaussian distribution samples using Python numpy.random.randn

From Dev

Random Number Generator using Geometric Distribution

From Dev

Random Number Generator using Geometric Distribution

From Dev

Generating 3D Gaussian distribution in Python

From Java

Gaussian distribution function different answer for program and math

From Dev

How to fit a double Gaussian distribution in Python?

From Dev

How to plot a Gaussian Distribution on y-axis?

From Dev

Apply a gaussian distribution in a specific part of an image

From Dev

Python - Integrating entire list with the Gaussian distribution

From Dev

Fitting bimodal gaussian distribution with some parameters fixed

From Dev

Create a matrix ( mx n) with gaussian random distribution

From Dev

How to extract values fitted to a gaussian distribution in R?

From Dev

redistribute data in Gaussian distribution with pd.DataFrame

From Dev

Gaussian blur using fft

Related Related

  1. 1

    Variance using Gaussian distribution Python

  2. 2

    Python: Creating a Gaussian distribution for a variable and running a program on a loop using the Gaussian values

  3. 3

    Python: Creating a Gaussian distribution for a variable and running a program on a loop using the Gaussian values

  4. 4

    Fitting an image to Gaussian distribution

  5. 5

    Multiple Gaussian distribution

  6. 6

    Dealing with normal (Gaussian) distribution

  7. 7

    Adding realistic noise to a gaussian distribution while keeping the number of samples above/below a threshold approximately constant

  8. 8

    Generating a chi-square distribution using goodness of fit test

  9. 9

    Generating a chi-square distribution using goodness of fit test

  10. 10

    Strange behaviour with Gaussian random distribution

  11. 11

    Fail to generate gaussian distribution with seed

  12. 12

    Gaussian distribution for censored regression with cenreg

  13. 13

    Inverse of the cumulative gaussian distribution in R

  14. 14

    Multivariate Gaussian distribution formula implementation

  15. 15

    Finding the square root of a number by using binary search

  16. 16

    Draw multivariate Gaussian distribution samples using Python numpy.random.randn

  17. 17

    Random Number Generator using Geometric Distribution

  18. 18

    Random Number Generator using Geometric Distribution

  19. 19

    Generating 3D Gaussian distribution in Python

  20. 20

    Gaussian distribution function different answer for program and math

  21. 21

    How to fit a double Gaussian distribution in Python?

  22. 22

    How to plot a Gaussian Distribution on y-axis?

  23. 23

    Apply a gaussian distribution in a specific part of an image

  24. 24

    Python - Integrating entire list with the Gaussian distribution

  25. 25

    Fitting bimodal gaussian distribution with some parameters fixed

  26. 26

    Create a matrix ( mx n) with gaussian random distribution

  27. 27

    How to extract values fitted to a gaussian distribution in R?

  28. 28

    redistribute data in Gaussian distribution with pd.DataFrame

  29. 29

    Gaussian blur using fft

HotTag

Archive