Sampling the univariate Normal by Box-Müller Transform | Example in Python

  Рет қаралды 5,572

Machine Learning & Simulation

Machine Learning & Simulation

Күн бұрын

Пікірлер: 30
@abhishekarora4007
@abhishekarora4007 2 жыл бұрын
Thank you. This is exactly i was looking for !
@MachineLearningSimulation
@MachineLearningSimulation 2 жыл бұрын
Glad I could help! You're welcome.
@johnnyg3007
@johnnyg3007 10 ай бұрын
Very helpful, thank you!
@MachineLearningSimulation
@MachineLearningSimulation 10 ай бұрын
You're welcome :). Thanks for the kind comment!
@samaradossantos9192
@samaradossantos9192 3 жыл бұрын
Thank you so much for this video. Really helped me!
@MachineLearningSimulation
@MachineLearningSimulation 3 жыл бұрын
You're very welcome :)
@andywang1950
@andywang1950 6 ай бұрын
Not sure if I'm mistaken or not. In your explanation, the formula is wrong since it's actually suppose to use "ln" rather than "log" For others looking at the math part of the explanation np.log is actually doing ln or Log base e got me confused for a while.
@MachineLearningSimulation
@MachineLearningSimulation 5 ай бұрын
Good catch. 👍 Indeed, it has to be "ln" for the correct box-muller transform. CS people tend to always just write log 😅
@YT-yt-yt-3
@YT-yt-yt-3 2 ай бұрын
but how does box muller method output normal distribution? i think that's important to understand.
@adetayoeyelade3912
@adetayoeyelade3912 Жыл бұрын
Can the Box-Muller model BE USED to make initial guess of a fitting parameters?
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
Hi, thanks for the question. :) Sure, the Box-Mueller transform is a valid way to produce normally distributed samples. If you want to initialize parameters according to a Normal distribution, this is one way to obtain these initial estimates. For example, in neural networks, one often uses a glorot normal initializer (a specially scaled normal distribution): www.tensorflow.org/api_docs/python/tf/keras/initializers/GlorotNormal I am unsure how it is implemented internally in TensorFlow, but a Box-Mueller transform would be my way to obtain these normal samples. Hope that helps :).
@jakebrowning2373
@jakebrowning2373 Жыл бұрын
Was the splitting up the 1000 uniform values into 2 500 length vectors a necessary step? Or was it just showcasing that both ways create a standard normal?
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
Alternatively, you could have also drawn two vectors of size 500. That would lead to a similar result. Hope that helped, let me know if that was not clear :).
@lidiatjr
@lidiatjr 2 жыл бұрын
Thank you!!
@MachineLearningSimulation
@MachineLearningSimulation 2 жыл бұрын
You're welcome :)
@palpadhading8245
@palpadhading8245 Жыл бұрын
What environment is this for ipy , I use google colab it's just not putting two plt.hist(X , bins=100) or plt(Y, bins=100) same time and not seeing two 2 colors
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
Do you want two histograms in one figure? I think that you then have to put the two plot calls into one cell. :) Hope that helps 😊
@SumriseHD
@SumriseHD Жыл бұрын
Wie kriegt man so einen guten Akzent? :D
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
Übung ist wichtig und natürlich auch der Wille, nicht zu deutsch zu klingen. 😅 Ich habe auch auf Englisch studiert und habe internationale Freunde, dadurch muss ich zwangsläufig viel auf Englisch reden.
@todianmishtaku6249
@todianmishtaku6249 2 жыл бұрын
Great!
@MachineLearningSimulation
@MachineLearningSimulation 2 жыл бұрын
Thanks for checking it out ;)
@guoqiqi-h2t
@guoqiqi-h2t Жыл бұрын
how to extend the box muller from 2 to n dimensions n>2
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
I think this is what you're looking for: kzbin.info/www/bejne/eoS6fmpjbsx-bdU :) In essence: you sample standard uniform normal in each dimension and then link the dimensions with the cholesky factor
@姐z
@姐z Жыл бұрын
thanks,but i mean Devise a method of generating n iid standard normal random samples (n ≥ 3) when chi-square and uniform random samples are given. (Hint: Extend the Box-Muller method in the lecture note to the n-dimensional case.)
@姐z
@姐z Жыл бұрын
@@MachineLearningSimulation thanks,but i mean Devise a method of generating n iid standard normal random samples (n ≥ 3) when chi-square and uniform random samples are given. (Hint: Extend the Box-Muller method in the lecture note to the n-dimensional case.)
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
Okay, I think I almost get what you would like to do. I'm afraid, this is beyond my expertise in this field.
@omarbranquinho8531
@omarbranquinho8531 2 жыл бұрын
Ver good
@MachineLearningSimulation
@MachineLearningSimulation 2 жыл бұрын
Nice, thanks a lot ❤️
@ccuuttww
@ccuuttww Жыл бұрын
no way for u to copy the content from the wiki btw this is the source for the transformation function :)
@MachineLearningSimulation
@MachineLearningSimulation Жыл бұрын
What do you refer to?
Normalization Constant for the Normal/Gaussian | Full Derivation with visualizations
11:59
Machine Learning & Simulation
Рет қаралды 5 М.
Sampling the Multivariate Normal distribution | example in Python
10:56
Machine Learning & Simulation
Рет қаралды 4 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 7 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 44 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 39 МЛН
Inverse Transform Sampling ... MADE EASY!!!
7:00
Learn Statistics with Brian
Рет қаралды 2 М.
Box-Muller Transform + R Demo
9:40
math et al
Рет қаралды 10 М.
The Box-Muller Transform (Proof and Python implementation)
27:34
StatMonteCarlo
Рет қаралды 7 М.
MLE for the Multivariate Normal distribution | with example in TensorFlow Probability
43:49
Inverse Transform Sampling - VISUALLY EXPLAINED with EXAMPLES!
13:29
Kapil Sachdeva
Рет қаралды 14 М.
Monte Carlo Methods : Data Science Basics
19:14
ritvikmath
Рет қаралды 125 М.
All Machine Learning algorithms explained in 17 min
16:30
Infinite Codes
Рет қаралды 307 М.
Gaussian Mixture Model | Intuition & Introduction | TensorFlow Probability
17:43
Machine Learning & Simulation
Рет қаралды 5 М.
Inverse Transform Sampling : Data Science Concepts
10:54
ritvikmath
Рет қаралды 58 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 7 МЛН