simulate.edp_population_model: Sample from a population model

Description Usage Arguments Value

View source: R/popmod.R

Description

Draw a sample from a population model.

Usage

1
2
3
## S3 method for class 'edp_population_model'
simulate(object, nsim = 1, seed = NULL, ...,
         target = NULL, columns = NULL, given = NULL, by_model = FALSE)

Arguments

object

an EDP population model, from popmod(...)

nsim

number of rows to simulate

seed

if set, an integer to pass to EDP as a random seed for this call

...

ignored, accepted for compatibility with simulate

target

a character vector of column names, defaults to names(pm)

columns

alias for target for compatibility with simulate

given

a single-row data frame of values to condition on; data.frame(a = 3) means to simulate from the conditional distribution given a is 3.

by_model

If false (the default), draws a sample of size nsim. If true, draws a sample of size nsim from each sub-model in the underlying model ensemble.

Value

A data frame with the columns specified in target. If by_model is true, the result contains an additional column, "model," specifying which sub-model that row came from.


edpclient documentation built on May 2, 2019, 2:01 p.m.