© Thomas Mailund 2018
Thomas MailundDomain-Specific Languages in Rhttps://doi.org/10.1007/978-1-4842-3588-1_10

10. Continuous-Time Markov Chains

Thomas Mailund1 
(1)
Aarhus N, Staden København, Denmark
 

We now turn to an example of a domain-specific language where we combine tidy evaluation and the magrittr pipe operator. We will write a language for specifying continuous-time Markov chains (CTMCs) and for computing the likelihood of parameters in such CTMCs given a trace of which states the chain is in at different time points. As with the list comprehension example in the previous chapter, we are not going to use operators to create a new syntax for the language but will create a DSL by providing functions that can be strung together to construct ...

Get Domain-Specific Languages in R: Advanced Statistical Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.