Show Menu
Cheatography

RevBayes Cheat Sheet (DRAFT) by

Rev language reference

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basics

Rev is an interp­reted language for statis­tical computing and phylog­enetic analysis.

Oper­ators and Functi­ons

# 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 Declar­ation and Assign­ment

Variable
Operator
Example
Constant
<-
a <- 1
Stochastic
~
x ~ dnExpo­nen­tia­l(l­ambda)
Determ­inistic
:=
b := exp(a)
Clamped
node.c­lam­p(data)
a.clamp(b)
Inference
=
Plate
for loops