CollapseMarginal: Collapse marginals

Description Usage Arguments Details Value Author(s) Examples

View source: R/CollapseMarginal.r

Description

Apply functions (only sample at the moment) over ovaribale indices

Usage

1
CollapseMarginal(variable, cols, fun = "mean", probs = NULL, ...)

Arguments

variable

an ovariable

cols

vector of column names or indices to collapse

fun

character name of function to be used to summarize

probs

list of vectors defining the distribution of values in a column index

...

excess arguments are ignored

Details

Samples over a fully defined column index (marginal) treating it as a nuisance parameter. Increases the joint distribution uncertainty (loses information). Weighted sampling is also possible.

Used to streamline heavy models (output has fewer rows of data).

See also: http://en.opasnet.org/

Value

Input ovariable with possibly lighter output.

Author(s)

T. Rintala [email protected]

Examples

1
2
3
test <- Ovariable("test", output = data.frame(City = c("Helsinki", "Espoo"), 
    Iter = 1, testResult = 1:2), marginal = c(TRUE, TRUE, FALSE))
CollapseMarginal(test, "City", "mean")

OpasnetUtils documentation built on July 4, 2017, 9:44 a.m.