티스토리 뷰
clc;
clear;
%Random Generating Numbers
n=10000;
%12 Uniform Random Number Method
a=rand(n,12);
new_rand=zeros(n,1);
for i=1:12
new_rand = new_rand+ a(:, i)
end
norm_rand = new_rand - 6;
subplot(1,3,1);
histfit(norm_rand);
xlabel('12-Method');
%Box-Muller Method
U1=rand(n,1);
U2=rand(n,1);
BXNORM=sqrt(-2*log(U1)).*cos(2*pi*U2);
subplot(1,3,2);
histfit(BXNORM);
xlabel('Box-Muller Method');
%Polar Rejection Method
v1=2*U1-1;
v2=2*U2-1;
S= v1.^2 + v2.^2;
PRNORM = v1.*sqrt((-2*log(S))./S);
subplot(1,3,3);
histfit(norm_rand);
xlabel('Polar Rejection Method');
'Language > Matlab R Python' 카테고리의 다른 글
| matlab manual 7 (0) | 2007.04.26 |
|---|
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 어렵다크레딧
- random gereragtor
- VBA
- Volatility Ratio
- CHF
- finance
- 금융수학
- Fallback rate
- XAG
- 금융공학
- 세식구
- Risk Free Rate
- market convention
- RfR
- LG
- Linear Gaussian Model
- JPY
- mathematical finance
- financial
- 회고2023
- computational finance
- SOFR
- 유동성최악
- 포트폴리오
- 가을
- recession
- 와인
- 리보중단
- 꿀떡이
- 크레딧투자
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
글 보관함