Box-Muller Transformation

PHOTO EMBED

Mon Oct 18 2021 17:09:56 GMT+0000 (Coordinated Universal Time)

Saved by @blurred_8216 ##python ##machinelearning

#!/usr/bin/python3

import numpy as np

# Please do not change the below function name and parameters
def transform(u1,u2):
    z1 = np.sqrt(-2* np.log(u1)) * np.cos(2*np.pi*u2)
    z2 = np.sqrt(-2* np.log(u1)) * np.sin(2*np.pi*u2)
    return (z1,z2)
content_copyCOPY

To convert Uniform distribution in Normal Distribution

https://mlpro.io/problems/transform/