Quiz 2

Stochastic Processes

68 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Stochastic Processes ## Markov Chain Simulation ## Stationary Distribution Solve $\pi P = \pi$ with $\sum \pi_i = 1$. [Join Discord](https://discord.gg/gE2m4Qrdqv) [Previous**MCMC**](/notes/04-degree-electives-bsma3014-statistical-computing-week06-06-mcmc)[Next**Numerical Linear Algebra**](/notes/04-degree-electiv...

Stochastic Processes

Markov Chain Simulation

python
import numpy as np
# Define transition matrix
P = np.array([[0.7, 0.3],
              [0.4, 0.6]])
# Simulate chain
n_steps = 1000
states = np.zeros(n_steps, dtype=int)
for t in range(1, n_steps):
    states[t] = np.random.choice([0, 1], p=P[states[t-1]])
print(f"Proportion in state 0: {np.mean(states == 0):.3f}")

Stationary Distribution

Solve πP=π\pi P = \pi with πi=1\sum \pi_i = 1. Join Discord PreviousMCMCNextNumerical Linear Algebra
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.