아무거나적어~
-
The Irwin-Hall distribution(Probability distribution of a sum of uniform random variables)아무거나적어~ 2023. 7. 31. 16:51
Probability distribution of a sum of uniform random variables Given a random variable $$X = \sum_i^n x_i,$$ where $x_i \in (a_i,b_i)$ are independent uniform random variables, how does one find the probability distribution of $X$? math.stackexchange.com
-
-
[python] np.random.normal 이 왜 정규분포에서 샘플한거임??아무거나적어~ 2023. 7. 30. 18:28
[확률과 통계] 파이썬으로 정규 분포 그리기 - Codetorial 2. 정규 분포 그리기 import numpy as np import matplotlib.pyplot as plt from scipy.special import erf np.random.seed(0) plt.style.use('default') plt.rcParams['figure.figsize'] = (6, 3) plt.rcParams['font.size'] = 12 plt.rcParams['lines.linewidth'] = codetorial.net
-
[python] '리스트 공간 확보 후 원소 대입'과 'list.append를 이용한 원소 삽입' 간 수행 시간 차이아무거나적어~ 2023. 7. 29. 21:08
[0, 1, 2, 3, ...] 와 같은 리스트를 생성해야 할 때, 전체 원소 크기만큼 리스트 공간을 확보 후 원소들을 대입하도록 하자 -> 내부적으로 list가 dynamic array 자료구조(자료구조가 초기에 할당한 배열의 capacity를 넘어설 때 더 큰 배열로 원소들을 옮겨야 됨)이기 때문에 append를 이용한 연산이 더 시간이 많이 걸리는 것으로 보인다 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 N = 10*6 def a(N): ret = [0]*N for i in range(N): ret[i] = i return ret def b(N): ret = [] for i in range(N): ret.append(i) return ret if..
-
[jupyter] !, % command 차이아무거나적어~ 2023. 7. 29. 17:34
https://stackoverflow.com/questions/45784499/what-is-the-difference-between-and-in-jupyter-notebooks What is the difference between ! and % in Jupyter notebooks? Both ! and % allow you to run shell commands from a Jupyter notebook. % is provided by the IPython kernel and allows you to run "magic commands", many of which include well-known shell stackoverflow.com
-
[python] timeit 모듈을 사용한 numpy 배열 제곱 비교아무거나적어~ 2023. 7. 29. 17:21
제곱만 하는 경우에는 np.power 는 사용하지 말자(느림) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import numpy as np X = np.arange(100).reshape((10, 10)) def a(N): return np.power(N, 2) def b(N): return X*X def c(N): return X**2 def d(N): return np.square(X) if __name__ == '__main__': import timeit print(timeit.timeit("a(X)", number=1000, globals=globals())) print(timeit.timeit("b(X)", number=1000, globa..