Samples posterior of the variance of a normal distibution which has the same additive structure on the mean and the log of variance. Usually used within MCMC loop.
sampleSig2b(sample,y,cond,sub,item,lag,N,I,J,R,ncond,nsub,nitem,
s2mu,s2a,s2b,met,blockMean,sampLag=1,Hier=1)
The function returns a new sample of a block of Sigma2 paramters.
Previous sample of block variances.
Vector of data
Vector of condition index,starting at zero.
Vector of subject index, starting at zero.
Vector of item index, starting at zero.
Vector of lag index, zero-centered.
Number of conditions.
Number of subjects.
Number of items.
Total number of trials.
Vector of length (N) containing number of trials per each condition.
Vector of length (I) containing number of trials per each subject.
Vector of length (J) containing number of trials per each item.
Prior variance on the grand mean mu; usually set to some large number.
Shape parameter of inverse gamma prior placed on effect variances.
Rate parameter of inverse gamma prior placed on effect variances. Setting both s2a AND s2b to be small (e.g., .01, .01) makes this an uninformative prior.
Vector of metropolis-hastins tuning parameters.
Block of parameters for the mean of the distribution.
Logical. Whether or not to sample the lag effect.
Logical. If TRUE then effect variances are estimated from data. If FALSE then these values are set to whatever value is in the s2alpha and s2beta slots of sample. This should always be set to TRUE.
Michael S. Pratte
This function is for a model with an additive structure on the log of the variance of a normal distribuiton. This model is under development, the code is buggy, and it might not even work in the end.
hbmem,sampleNormb