Sale!

Monte Carlo Function

17

Description

import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as ss
import random as  r
import datetime

 

def     monte ( parameters , samples ) :
tau_1 , beta_1 , tau_2 , beta_2 = parameters

# Here we create 2 distributions x and y
# They are normally distributed but correlated according to the covariance matrix ' cov '

mean = [ 0 , 0 ]
cov = [ [ 1 , 0.95 ] , [ 0.95 , 1 ] ] # diagonal covariance

x , y = np. random. multivariate_normal(mean , cov , samples ).T

# Here we change the normally distributed numbers to uniformly distributed numbers
# between 0 and 1

x = ss . norm.cdf ( x )
y = ss . norm.cdf ( y )


.
.
.

54 line pyhton code .

https://matlab1.com/interaction-of-beta-particles-with-matter/

https://en.wikipedia.org/wiki/Monte_Carlo_method

Reviews

There are no reviews yet.

Be the first to review “Monte Carlo Function”

Your email address will not be published. Required fields are marked *

SKU: 10610309_1 Category: