multibd's People
multibd's Issues
Simple birth-and-death process probabilities do not sum to 1
If I understood the model correctly, the following rates in a birth/birth-death process should correspond to a simple (linear) birth-and-death process:
lambda_1 = 0
lambda_2 = b * lambda
mu_2 = b * mu
trans_12 = 0
but when I try to sum all the probabilities from 0 to a large number, I get a value very far from 1:
library(MultiBD)
lambda <- 1.0
mu <- 2.0
brates1 <- function(a, b) { 0 }
brates2 <- function(a, b) { b * lambda }
drates2 <- function(a, b) { b * mu }
trans21 <- function(a, b) { 0 }
p <- bbd_prob(t=2.0, a0=0, b0=100, brates1, brates2, drates2, trans21, A=0, B=1000)
sprintf("%.20f", sum(p))
Note that most of the values are zero, so increasing the upper bound does not improve the accuracy.
I don't understand if I misinterpreted the model or there is a bug in the code.
If it is not a bug, what rates should I define to obtain a simple death-and-birth process?
Form of the returned matrix
Hi, I'm not 100% clear on the form of the returned matrix - am I right in thinking that after running
mat <- dbd_prob( ... a0 = 2, b0 = 5 ...)
(with all the other parameters)
Then mat[1,7]
will be the probability of going from state (2,5) to state (0,6) (in the given time and with the given parameters)? And mat[3,9]
would be the probability of going to state (2,8)?
I'm a bit confused because in the 'short example' in the readme, the indexing is done like
[1, data$I[k + 1] + 1] # To: S(t_(k+1)), I(t_(k+1))
and I don't completely understand what's going on here, particularly why the first index is 1.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.