SMS_BP
Single Molecule Simulations -BP
Loading...
Searching...
No Matches
SMS_BP.fbm_BP Namespace Reference

Classes

class  FBM_BP
 

Functions

 MCMC_state_selection (int initial_state_index, np.ndarray transition_matrix, np.ndarray possible_states, int n)
 
 _boundary_conditions (float fbm_store_last, float fbm_candidate, np.ndarray space_lim, str condition_type)
 

Variables

dict BOUNDARY_CONDITIONS
 
 transition_matrix = np.array([[0.4, 0.6], [0.2, 0.8]])
 
 possible_states = np.array([1, 2])
 
int n = 50000
 
int initial_state_index = 1
 
 state_select
 
 state_probability = np.zeros(len(possible_states))
 
 total_rate = np.sum(transition_matrix)
 
 true_state_probability = np.sum(transition_matrix, axis=0)/total_rate
 
 label
 
 alpha
 
int state_1_to_2 = np.zeros(n) - 1
 
int state_2_to_1 = np.zeros(n) - 1
 

Function Documentation

◆ _boundary_conditions()

SMS_BP.fbm_BP._boundary_conditions ( float fbm_store_last,
float fbm_candidate,
np.ndarray space_lim,
str condition_type )
protected
Boundary conditions for the FBM

Parameters:
-----------
fbm_store_last : float
    Last value of the FBM
fbm_candidate : float
    Candidate value of the FBM
space_lim : np.ndarray
    Space limit (min, max) for the FBM\
condition_type : str
    Type of boundary condition takes values in REFLECTING_CONDITIONS
Returns:
--------
float
    New value of the FBM

◆ MCMC_state_selection()

SMS_BP.fbm_BP.MCMC_state_selection ( int initial_state_index,
np.ndarray transition_matrix,
np.ndarray possible_states,
int n )
Markov Chain Monte Carlo state selection

Parameters:
-----------
initial_state_index : int
    Initial state index, this is the index of the initial state in the possible states
transition_matrix : np.ndarray
    Transition matrix, this is the prbability at a time step. (time step is 1) 
possible_states : np.ndarray
    possible states
n : int
    Number of iterations

Returns:
--------
np.ndarray
    State selection at each iteration

Variable Documentation

◆ alpha

SMS_BP.fbm_BP.alpha

◆ BOUNDARY_CONDITIONS

dict SMS_BP.fbm_BP.BOUNDARY_CONDITIONS
Initial value:
1= {
2 'reflecting': _refecting_boundary,
3 'absorbing': _absorbing_boundary
4}

◆ initial_state_index

int SMS_BP.fbm_BP.initial_state_index = 1

◆ label

SMS_BP.fbm_BP.label

◆ n

int SMS_BP.fbm_BP.n = 50000

◆ possible_states

SMS_BP.fbm_BP.possible_states = np.array([1, 2])

◆ state_1_to_2

int SMS_BP.fbm_BP.state_1_to_2 = np.zeros(n) - 1

◆ state_2_to_1

int SMS_BP.fbm_BP.state_2_to_1 = np.zeros(n) - 1

◆ state_probability

SMS_BP.fbm_BP.state_probability = np.zeros(len(possible_states))

◆ state_select

SMS_BP.fbm_BP.state_select
Initial value:
1= MCMC_state_selection(
2 initial_state_index, transition_matrix, possible_states, n)

◆ total_rate

SMS_BP.fbm_BP.total_rate = np.sum(transition_matrix)

◆ transition_matrix

SMS_BP.fbm_BP.transition_matrix = np.array([[0.4, 0.6], [0.2, 0.8]])

◆ true_state_probability

SMS_BP.fbm_BP.true_state_probability = np.sum(transition_matrix, axis=0)/total_rate