constrainNStack

Share:

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.