Questions tagged [markov-chains]

Questions that deal with modeling and simulating random processes which switch between states under the Markov assumptions.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

Problem with solving a system of equations based on a matrix

I am trying to solve a system of equations based on a matrix in order to find the "stationary" matrix. the code I've written should break the matrix down into a system of equations such that some ...
4
votes
0answers
97 views

Fit Markov Chain

Assume a simple Markov Chain with the transition matrix ...
4
votes
1answer
164 views

The probability of reaching the absorbing states from a particular transient state?

Can I use the data available from MarkovProcessProperties to compute the probability of reaching each of the absorbing states from a particular transient state? In an earlier post, kglr showed a ...
0
votes
1answer
64 views

Finding Steady States that Meet Additional Constraints

I've written a function that returns the steady state given a regular, column-stochastic matrix. I want to use it to solve a larger problem, finding steady states that satisfy certain conditions. The ...
0
votes
1answer
83 views

How to simulate a Markov chain from the output of two other Markov chains?

I have a Markov chain defined by the output of two other Markov chains as time passes. (i.e., Z = X + Y). How do I program such a Markov chain in Mathematica?
4
votes
1answer
69 views

Plotting absorbing state probabilities from state 1

I have the following transition matrix: ...
22
votes
3answers
2k views

Efficient way to simulate thousands of Markov chains

I am currently trying to simulate relaxation of a protein population while maintaining the stochastic properties of the system. For this, I used a Markov chain to describe the temporal evolution of ...
6
votes
4answers
186 views

Constructing higher order transition probability matrix

Recently I asked a question here about how to construct a transition probability matrix given the following list: ...
4
votes
3answers
259 views

Constructing transition probability matrix

I have the following list: ...
7
votes
2answers
277 views

How to make a cow smaller (in BubbleChart3D plot)

I've been using random walk Metropolis to sample from the (unnormalised distribution) which is defined as $p(r)\propto e^{-100 r}$, where $r$ is the perpendicular distance of a point in 3D space from ...
3
votes
1answer
287 views

Metropolis-Hastings Algorithm Problem

I've been trying to implement the Metropolis-Hastings algorithm for a while but there seems to be something weird going on. This algorithm does not need as much of the statistics to understand, and ...
4
votes
1answer
154 views

FindShortestPath in Markov Transition Matrix

So I have a part of transition matrix like this. ...
1
vote
1answer
213 views

Deriving 68% confidence level for each parameter after MCMC

I used the MCMC package https://github.com/joshburkart/mathematica-mcmc to find the best parameters for model of Massive Gravity. Now I need to find the confidence 68% for each of those parameters and ...
3
votes
1answer
158 views

MCMC problem for Acoustic Scale Cosmology

I'm using this MCMC Mathematica package https://github.com/joshburkart/mathematica-mcmc to do a MCMC on number of different data sets for a problem. I'm almost done but I have one problem. Whenever I ...
0
votes
1answer
56 views

Evaluated To Non-Numerical Values Error using MCMC package Mathematica Via NIntegrate

I'm using this package https://github.com/joshburkart/mathematica-mcmc and am trying to evaluate the following: ...
1
vote
0answers
105 views

Error using MCMC package Mathematica Via NIntegrate

I'm using this package https://github.com/joshburkart/mathematica-mcmc and am trying to evaluate the following: ...
1
vote
0answers
39 views

What's going on with this FirstPassageTimeDistribution performance quirk?

Observe: ...
5
votes
0answers
557 views

Estimate process parameters of geometric Brownian motion with a two-state Markov chain

I have the following sequence. Consider a model that follows a geometric Brownian motion whose drift switches between two different regimes representing the up trend and down trend. The regime ...
4
votes
0answers
171 views

Why is this non-vectorized NDSolve faster than vectorized?

I'm trying to get a feeling for stochastic population models. A simple starting place is a birth-death process whose deterministic limit is the logistic equation. The idea is to model the probability <...
2
votes
1answer
95 views

Issue with EdgeLabels

I want to reproduce Shannon's telegraph Markov chain from A Mathematical Theory of Communication. EdgeLabels isn't doing the trick here: ...
1
vote
0answers
76 views

Generalization of DiscreteMarkovProcess?

I am trying to create a Markov chain using the initial state of a probabilistic cellular automaton, that is a list of length 8, as the first argument of the function ...
7
votes
0answers
68 views

Problem/bug with `RandomVariate` and `FirstPassageTimeDistribution`?

...
1
vote
0answers
204 views

Training Hidden Markov Models using Mathematica

I have created a Hidden Markov Process with an initial probability vector, emission and transmission matrices. ...
1
vote
0answers
329 views

Hidden Markov Model: emissions probabilities dependent on observable parameter

I need to fit an HMM where the emission probabilities (ep) are discrete and dependent on a known variable quantity. E.g.: Imagine a daily time series of binary emissions ("1" or "2"). I suppose an ...
1
vote
1answer
214 views

Nonlinear Markov chain (numerical simulation)

Suppose you have a linear Markov process, and you can write it as x(t+1) = Ax(t). Here x is the vector of values, and A is the transition matrix. Since this is linear, it can be solved analytically, ...
4
votes
1answer
107 views

Use (network) graph as vertex

I have a Markov chain with graphs as the states. Basically how one network structure would evolve to another in the next period. To avoid confusion, I'll use the term "network" instead of "graph". I ...
1
vote
0answers
328 views

What's the algorithm behind markov classifier in Classify function for text classification?

https://www.wolfram.com/mathematica/new-in-10/highly-automated-machine-learning/find-which-author-wrote-a-text.html The above url show the use of Classify ...
-1
votes
2answers
152 views

Using Mathematica to calculate expected time to absorption [closed]

I am trying to solve a standard ETA on a birth-death process with $n$ states $\in \{0,\cdots,n-1\}$ where state $n-1$ is absorbing. Also $\mu_i$ is the expected time to absorption starting at state $i$...
2
votes
1answer
222 views

Part specification error with InterpolatingFunction when generating a Markov Modulated Poisson Process

I want to create a Markov Modulated Poisson Process, where the arrival rates created by the states of a ContinuousMarkovProcess are fed into an ...
0
votes
2answers
128 views

Question RE DiscreteMarkovProcess Graph Labels

I'm trying to label the arc's of my Markov chain with symbols like $\alpha$, $\beta$, etc., to show how the Markov chain looks abstractly. So, I did this... ...
2
votes
0answers
90 views

What do the default shapes/colors in DiscreteMarkovProcess Graph mean?

In making markov chains, I know how to do that, but I am curious as to what the different colors, and shapes of the vertexes in the graph output mean. as example; ...
1
vote
0answers
107 views

Fit a custom process to a data: inhomogeneous 2-state Markov chain

I would like to fit a custom process - a time inhomogeneous 2-state Markov chain, to data. The time inhomogeneity is a result of the transition probabilities varying sinusoidally through time with a ...
3
votes
2answers
473 views

Time inhomogeneous Markov Chain in Mathematica

I would like to create a discrete 2-state Markov process, where the switching probabilities in the transition matrix vary with time. I can currently do the following, which creates a process with ...
1
vote
1answer
706 views

Code efficiency improvement needed solving problem 499 in Project Euler

I am trying to solve https://projecteuler.net/problem=499 by constructing a transition matrix and finding its steady state. Here is my code: ...
3
votes
3answers
216 views

Problem with a Markov's Matrix

I recently discovered the Markov process. To simplify my work, I use the following code taken from the DiscreteMarkovProcess documentation: ...
2
votes
1answer
512 views

Where can I find a good tutorial for stochastic modeling using Mathematica?

I am a newbie in Mathematica and I aim to use Mathematica mostly for stochastic modeling (to develop and analyze models in evolutionary biology). Note that I am not necessarily a great mathematician ...
0
votes
1answer
374 views

My Baum-Welch algorithm is very slow. Is it due to Mathematica?

I've also posted this question here, since I'm not sure which community is more adequate for this type of question. I've programmed imperatively the Baum-Welch algorithm for a 2 state hidden Markov ...
1
vote
0answers
358 views

Calculate the power spectral density of a Markov chain

I would like to calculate the symbolic power spectral density of a two state Markov process with a symbolic transition matrix characterised by two parameters. I have tried the code below, but it ...
3
votes
2answers
228 views

Expectation of a composite Markov-Gamma distribution

In a model I have a discrete two-state first order Markov process, defined by a (2x2) transition matrix with two free parameters. If the first state occurs then the process outputs zero for that ...
9
votes
1answer
144 views

Why am I getting wildly incorrect results from FirstPassageTimeDistribution with inexact transition matrix?

Working on some large systems using DiscreteMarkovProcess, I changed the transition matrix to machine precision vs using exact values, which sped things up handily. ...
5
votes
2answers
389 views

State “i” goes to state “j”: list accessible states in a Markov-chain

I would like to have a code that given a state "i" in S, it give the set of states "j" which are accessible from "i". Is that possible in mathematica? My state space (S) is ...
2
votes
1answer
275 views

Arranging “ranked” nodes of a graph symmetrically

I have Markov chains with a pair of absorbing states taken from the $n$-length strings formed from {"H","T"} for n at least 3 (...
4
votes
3answers
310 views

How do I change the initial state of a discrete Markov process?

I have a simple Markov process defined with ...
7
votes
2answers
1k views

How do I show the transition probabilities in a graph of a Markov process?

How do I get Graph to display the transition probabilities for a Markov process as labels on the graph's edges? The information is clearly present in the graph, but ...
1
vote
1answer
278 views

Multiple Simulations of a Markov Chain

I am trying to create a simple series of Bernoulli bits whose probabilities follow a two-state Markov chain. ...
7
votes
2answers
352 views

How to impose control over vertex-to-vertex Graph edges?

I’m working on a Markov Chain and hope there is a way to impose control over how Mathematica places edges to connect vertices in a Graph. My Markov Chain currently ...
4
votes
0answers
207 views

random Poisson process over multiple variables (state vector) for chemical kinetics

Has anyone figured out how to coerce ContinuousMarkovProcess to work with a state vector, transition matrix, and rate (propensity) vector, and RandomFunction to return pairs of state vector and time, ...
2
votes
1answer
484 views

How to obtain the number of Markov Chain transitions in a simulation?

I would like to obtain the number of transitions from each state in a Markov Chain simulation to other states, including back to itself so I can compare the simulation results to the transition matrix....
6
votes
1answer
545 views

Nicely illustrating the evolution and end-state of a discrete-time Markov chain

I'm simulating a discrete time Markov process on a finite state space corresponding to a linear interval $(x_1, x_2, ..., x_N) \in X$, where each time step $t_i$ involves updating the state of some ...
1
vote
1answer
177 views

Defining a function of a distribution

I have a discrete- time and space markov process that I want to evolve given an initial distribution. To that, I defined ...