state graph — Bull / Neutral / Bear
portfolio balance$10,000
Balance
stationary distribution π (power iteration)
time spent per state (this run)

Markov Market Regimes — Portfolio Simulator

A three-state Markov chain (Bull, Neutral, Bear) drives a Monte-Carlo simulation of a portfolio's balance. Edit the transition matrix directly — each row renormalises to sum to 1 as you drag — and watch the state graph, the balance trajectory, the live stationary distribution (computed by power iteration on P) and the histogram of time spent in each regime all update together.