blca.em.sd: Posterior Standard Deviation Estimates for Bayesian Latent...

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

View source: R/blca.em.sd.R

Description

Returns posterior standard deviation estimates for point estimates returned by blca.em. These are obtained via asymptotic estmation of the Observed Information matrix. The Hessian of the log-posterior is also checked to determine whether point estimates occur at at least a local maximum.

Usage

1
blca.em.sd(fit, x, counts.n = 1)

Arguments

fit

An object of class "blca.em".

x

A binary matrix. An object of class data.blca may also be supplied. In this case the argument counts.n is ignored.

counts.n

A vector which supplies the corresponding number of times each pattern in X occurs in the data.

Details

This function is primarily intended for use in conjunction with blca.em, and may be called directly by that function by setting se=TRUE. However it can in fact be used with any blca object.

Value

A list containing:

itemprob

Posterior standard deviation estimates of the item probabilities.

classprob

Posterior standard deviation estimates of the class probabilities.

convergence

An integer value denoting whether point estimates occur at at least a local maximum. 1 denotes acceptable convergence, 2 denotes that it converged at a saddle point, 3 that the algorithm ended before it converged and 4 denotes that at least one parameter value converged at a boundary value.

Note

The posterior standard deviation estimates are derived asymptotically, i.e., by inverting the information matrix of the parameters. These values are known to be unreliable in cases where parameters estimates are close to 1 or 0, so caution is advised when checking their values. Bootstrapping methods may provide better estimates.

Computationally, the method becomes becomes unstable for values close to 1 or 0. If the distance of any of the supplied parameter values from 0 or 1 is <1e-5, then posterior standard deviation estimates for these values are returned as 0.

Earlier versions of this function erroneously referred to posterior standard deviations as standard errors. This also extended to the function name, which has now been corrected to blca.em.sd (for standard deviation). For backwards compatability reasons, the earlier function blca.em.se has been retained as an in internal function.

Author(s)

Arthur White

See Also

blca.em, blca.boot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
type1 <- c(0.8, 0.8, 0.2, 0.2)
type2 <- c(0.2, 0.2, 0.8, 0.8)
x<- rlca(1000, rbind(type1,type2), c(0.6,0.4))
dat<- data.blca(x)

set.seed(1)
fit1 <- blca.em(dat, 2, se=TRUE)
fit1$itemprob.sd
fit1$classprob.sd

set.seed(1)
fit2<- blca.em(dat, 2, se=FALSE)
fit2.sd<- blca.em.sd(fit2, dat)
fit2.sd$itemprob
fit2.sd$classprob

Example output

Loading required package: e1071
Loading required package: coda
Restart number 1, logpost = -2457.77... 
New maximum found... Restart number 2, logpost = -2457.77... 
New maximum found... Restart number 3, logpost = -2457.77... 
Restart number 4, logpost = -2457.77... 
Restart number 5, logpost = -2457.77... 
NULL
NULL
Restart number 1, logpost = -2457.77... 
New maximum found... Restart number 2, logpost = -2457.77... 
New maximum found... Restart number 3, logpost = -2457.77... 
Restart number 4, logpost = -2457.77... 
Restart number 5, logpost = -2457.77... 
           [,1]       [,2]       [,3]       [,4]
[1,] 0.02204889 0.02091259 0.02173067 0.02325060
[2,] 0.02540384 0.02681723 0.02603183 0.02426067
[1] 0.02462469 0.02462569

BayesLCA documentation built on July 2, 2020, 12:11 a.m.