webppl: webppl

Description Usage Arguments Value Examples

Description

Runs a webppl program.

Usage

1
2
3
4
webppl(program_code = NULL, program_file = NULL, data = NULL,
  data_var = "data", packages = NULL, model_var = "model",
  inference_opts = NULL, random_seed = NULL, sort_by = "prob",
  chains = 1, cores = 1)

Arguments

program_code

A string of a webppl program.

program_file

A file containing a webppl program.

data

A data frame (or other serializable object) that can be referenced in the program.

data_var

A name by which data can be referenced in the program.

packages

A character vector of external package names to use.

model_var

The name by which the model be referenced in the program.

inference_opts

Options for inference (see http://webppl.readthedocs.io/en/master/inference.html)

random_seed

Seed for random number generator

sort_by

Sort probability table by probability or support (enumeration only)

chains

Number of times to run the program (defaults to 1).

cores

Number of cores to use when running multiple chains (defaults to 1).

Value

The program's return value(s).

Examples

1
2
3
4
5
## Not run: 
program_code <- "flip(0.5)"
webppl(program_code)

## End(Not run)

mhtess/rwebppl documentation built on May 22, 2019, 8:57 p.m.