This is a draft cheat sheet. It is a work in progress and is not finished yet.
Basics
Rev is an interpreted language for statistical computing and phylogenetic analysis. |
Operators and Functions
# Simple mathematical operators:
1 + 1 # Addition
10 - 5 # Subtraction
5 * 5 # Multiplication
10 / 2 # Division
2^3 # Exponentiation
5%2 # Modulo
# Math functions
exp(1) # exponential function
ln(1) # logarithmic function
sqrt(16) # square root function
power(2,2) # power function
|
Variable Declaration and Assignment
Variable |
Operator |
Example |
Constant |
<- |
a <- 1 |
Stochastic |
~ |
x ~ dnExponential(lambda) |
Deterministic |
:= |
b := exp(a) |
Clamped |
node.clamp(data) |
a.clamp(b) |
Inference |
= |
Plate |
for loops |
|
|
|
|
|