コード例 #1
0
from calculates import calculate
from profile import letters

import numpy as np

count = 200
n = letters.get('m') + 4
x = [1, 2, 3, 4, 5]
p = [0.04 * letters.get('a'), 0.1 * letters.get('b'), 0.02 * letters.get('g') + 0.03 * letters.get('m'),
     0.01 * letters.get('n') + 0.04 * letters.get('q'),
     1 - (0.04 * letters.get('a')
          + 0.1 * letters.get('b')
          + 0.02 * letters.get('g')
          + 0.03 * letters.get('m')
          + 0.01 * letters.get('n')
          + 0.04 * letters.get('q'))]
print(p)
values = np.random.choice(x, count, p=p)
calculate(values)

コード例 #2
0
import numpy as np

from calculates import calculate
from profile import letters


count = 100
a = letters.get('m')
sigma = letters.get('n') + 1
values = np.random.normal(a, sigma, size=count)
calculate(values)
コード例 #3
0
ファイル: task1.py プロジェクト: iskanderkhisamov/KM_laba7
from calculates import calculate
from scipy.stats import binom
from profile import letters


count = 200
p = (5 * letters.get('m') + 5 * letters.get('n') + 10) / 100
n = 2 + letters.get('m') + letters.get('n')
values = binom.rvs(n, p, size=count)
calculate(values)

コード例 #4
0
import numpy as np

from calculates import calculate
from profile import letters

count = 200
l = letters.get('m') + letters.get('n') + letters.get('q')
values = np.random.exponential(l, size=count)
calculate(values)
コード例 #5
0
import numpy as np

from calculates import calculate
from profile import letters


count = 200
p = 0.08 * letters.get('m') + 0.02 * letters.get('n')
n = 30 + 1 + letters.get('n')
values = np.random.poisson(n * p, count)
calculate(values)