constrainNStack: constrainNStack

Description Usage Arguments Details Value Author(s) See Also

View source: R/initZ.R

Description

Subsetting a sequence of parameter vectors. Keeps only the n cases in pss1 that are closest to thetaPrior.

Usage

1
2
3
4
constrainNStack(pss1, thetaPrior, n = nrow(pss1)%/%4, vars = names(thetaPrior), 
    invCovarTheta = if (0 < length(thetaPrior)) solve(cov(pss1[, 
        names(thetaPrior[vars]), drop = FALSE])) else numeric(0), 
    returnAlpha = FALSE)

Arguments

pss1

numeric matrix: the stack to constrain, see details

thetaPrior

the point in parameter spcae for which to select the closest values

n

the number of rows in output, defaults to 1/4 of nrow(pss1)

vars

names or indices to constrain thetaPrior and invCovarTheta

invCovarTheta

the inverse of the covaraince matrix for thetaPrior, defaults to inverse of sample covariance

returnAlpha

switch to return also significance level

Details

pss1 is a matrix with columns corresponding to variables and rows corresponding to cases. It is typicalla the result of stackChains.twDEMC

Value

pss1[closestValues,] if returnAlpha=TRUE then a list is returned with

res

value as above

alpha

the significance level of the corresponding confidence ellipsis

Author(s)

Thomas Wutzler

See Also

initZtwDEMCNormal constrainCfStack


twDEMC documentation built on May 31, 2017, 3:44 a.m.