c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6.2 KiB
6.2 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-시뮬레이션과-예측-모델링-simulation-and-pre | 시뮬레이션과 예측 모델링(Simulation and Predictive Modeling) | 10_Wiki/Topics | verified | self |
|
none | A | 0.88 | applied |
|
2026-05-10 | pending |
|
시뮬레이션과 예측 모델링(Simulation and Predictive Modeling)
매 한 줄
"매 closed-form 의 unattainable 의 distribution 의 sampling 의 estimate". 매 Monte Carlo / discrete-event / agent-based 의 3 family — 매 risk pricing, capacity planning, A/B effect 의 forecast 의 backbone. 매 2026 의 PyMC 5, NumPyro, SimPy 4, Mesa 3 의 standard.
매 핵심
매 simulation 3 family
- Monte Carlo: 매 random sampling → integral/expectation 의 estimate. (option pricing, risk VaR.)
- Discrete-event (DES): 매 event timeline 의 advance — queue, server, arrival. (call center, factory.)
- Agent-based (ABM): 매 individual agent + rule + interaction → emergent behavior. (epidemic, market.)
매 predictive modeling vs simulation
- predictive (regression/ML): 매 historical → future point estimate.
- simulation: 매 process model + uncertainty → distribution.
- hybrid: 매 ML predict mean, 매 simulation propagate variance.
매 validation
- 매 backtesting (walk-forward).
- 매 calibration (Brier / reliability diagram).
- 매 sensitivity analysis (Sobol indices).
- 매 convergence check (running mean ± CI).
💻 패턴
Monte Carlo — π estimate
import numpy as np
N = 1_000_000
xy = np.random.uniform(-1, 1, size=(N, 2))
inside = (xy[:,0]**2 + xy[:,1]**2 <= 1).mean()
pi_est = 4 * inside # ~3.1416
European call (Black-Scholes MC)
import numpy as np
S0, K, r, sigma, T, N = 100, 105, 0.05, 0.2, 1.0, 200_000
Z = np.random.standard_normal(N)
ST = S0 * np.exp((r - 0.5*sigma**2)*T + sigma*np.sqrt(T)*Z)
payoff = np.maximum(ST - K, 0)
price = np.exp(-r*T) * payoff.mean()
se = np.exp(-r*T) * payoff.std() / np.sqrt(N) # standard error
Variance reduction — antithetic
half = N // 2
Z = np.random.standard_normal(half)
Z_anti = np.concatenate([Z, -Z])
ST = S0 * np.exp((r - 0.5*sigma**2)*T + sigma*np.sqrt(T)*Z_anti)
# 매 same N, lower variance
Discrete-event (SimPy)
import simpy, random
def customer(env, server):
arrive = env.now
with server.request() as req:
yield req
wait = env.now - arrive
yield env.timeout(random.expovariate(1/3)) # service ~Exp(mean=3)
results.append(wait)
env = simpy.Environment()
server = simpy.Resource(env, capacity=2)
results = []
def arrivals(env):
while True:
yield env.timeout(random.expovariate(1/2)) # arrival ~Exp(mean=2)
env.process(customer(env, server))
env.process(arrivals(env))
env.run(until=1000)
print('avg wait', sum(results)/len(results))
Agent-based (Mesa 3, sketch)
from mesa import Agent, Model
from mesa.time import RandomActivation
class Trader(Agent):
def step(self):
# simple momentum rule
if self.model.price > self.last_price: self.buy()
else: self.sell()
self.last_price = self.model.price
class Market(Model):
def __init__(self, n):
self.schedule = RandomActivation(self)
self.price = 100
for i in range(n): self.schedule.add(Trader(i, self))
def step(self):
self.schedule.step()
# update price by net demand ...
Bayesian forecasting (PyMC 5)
import pymc as pm
with pm.Model() as m:
mu = pm.Normal('mu', 0, 10)
sigma = pm.HalfNormal('sigma', 5)
y = pm.Normal('y', mu=mu, sigma=sigma, observed=data)
trace = pm.sample(2000, tune=1000, chains=4)
with m:
ppc = pm.sample_posterior_predictive(trace, var_names=['y'])
# 매 forecast distribution + uncertainty
Bootstrap CI
import numpy as np
def bootstrap_ci(data, stat=np.mean, B=10_000, alpha=0.05):
boot = [stat(np.random.choice(data, size=len(data), replace=True)) for _ in range(B)]
return np.quantile(boot, [alpha/2, 1-alpha/2])
Sensitivity (Sobol)
from SALib.sample import saltelli
from SALib.analyze import sobol
problem = {'num_vars': 3, 'names': ['x1','x2','x3'],
'bounds': [[0,1]]*3}
X = saltelli.sample(problem, 1024)
Y = np.array([model(*x) for x in X])
Si = sobol.analyze(problem, Y)
print(Si['ST']) # total-order indices
매 결정 기준
| 문제 | Approach |
|---|---|
| Integral / expectation | Monte Carlo |
| Queue / capacity | Discrete-event (SimPy) |
| Heterogeneous actors + interaction | Agent-based (Mesa) |
| Forecasting + uncertainty | Bayesian (PyMC / NumPyro) |
| Calibration / quantification | bootstrap / Sobol |
| 매 large N + GPU | NumPyro (JAX) |
기본값: 매 simple expectation → MC 의 NumPy, 매 queue → SimPy, 매 forecast w/ uncertainty → PyMC 5.
🔗 Graph
- 부모: Statistics · Forecasting
- 변형: Monte Carlo · MCMC
- 응용: Risk Management
- Adjacent: Bayesian_Inference
🤖 LLM 활용
언제: model assumption 의 review, variance reduction 의 propose, sensitivity result 의 interpret. 언제 X: large-scale agent simulation 의 direct execution — specialized engine 의 use.
❌ 안티패턴
- N 의 too small: 매 standard error 의 estimate 의 누락 — running mean check.
- PRNG 의 fixed seed forever: 매 single-path bias — multiple seeds 의 ensemble.
- Closed-form available 의 simulate: 매 unnecessary — analytical solution 의 prefer.
- Calibration 누락: 매 forecast 의 overconfident — Brier/reliability 의 add.
🧪 검증 / 중복
- Verified (Glasserman "Monte Carlo Methods in Financial Engineering", Law "Simulation Modeling and Analysis", PyMC 5 / SimPy 4 docs).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — MC/DES/ABM + PyMC + Sobol 의 정리 |