marginals1d: marginals1d

Description Usage Arguments Details Value Author(s) See Also Examples

Description

integrate over all others but 1 column

Usage

1
2
3
marginals1d(x,
 vars = 2, intCol = 1, n = round(nrow(x)/12), dimnames = .colNames(x, 
    vars), fAgg = mean, ...)

Arguments

x

numeric matrix

vars

index (integer or string): column to define integration boxes

intCol

index (integer or string): column to average

n

number of groups, defaults to about 10 observations per group

dimnames

dimension names of the result array

fAgg

function applied over the subsets of x[,intCol]

...

further arguments to fAgg

Details

There are several methods to get calculate marginal densities for multivariate sample.

Value

numeric vector with each item representing application of fAgg to x[,intCol] and dimnames equal to means of the classes

Author(s)

Thomas Wutzler

See Also

twDEMCBlockInt

Examples

1
2
3
4
5
data(twdemcEx1)
sample <- stackChains(twdemcEx1)
#res <- marginals1d(sample,vars="kO",n=20)
res <- marginals1d(sample,vars="b",n=20)
plot( res ~ as.numeric(names(res)) )

twDEMC documentation built on May 2, 2019, 5:38 p.m.