update_gamma {EMSNM} | R Documentation |
Updata Alpha and Sigma
Description
Updata alpha and sigma in t+1 step with given data and coeffients estimated in step t.
Usage
update_gamma(alphat, sigmat, etat, X, Z, Y)
Arguments
alphat |
the estimated coeffients of the mean of each subgroup in step t |
sigmat |
the estimated standard error of Y in step t |
etat |
the estimated coeffients determining subgroup in step t |
X |
the covariables of the mean of each subgroup |
Z |
the covaraibles determining subgroup |
Y |
the respond variable |
Value
alpha |
alpha estimated in step t+1. |
eta |
eta estimated in step t. |
sigma |
sigma estimated in step t+1. |
Author(s)
Linsui Deng
Examples
#some variables
samplesize <- 1000
classsize <- 6
etasize <- 3
alphasize <- 2
Xtest <- data.frame(matrix(rnorm(samplesize*etasize),samplesize,etasize))
Ztest <- matrix(rnorm(samplesize*alphasize),samplesize,alphasize)
etatest <- matrix(seq(1.15,1,length=etasize*classsize),etasize,classsize)
alphatest <- matrix(seq(1.15,1,length=alphasize*classsize),alphasize,classsize)
sigmatest <- 0.1
Wtest <- Wgenerate(alpha=alphatest,eta=etatest,X=Xtest,Z=Ztest)
#test of updata_gamma
thetaupdate_gamma <- update_gamma(alphat=alphatest,sigmat=sigmatest,
etat=etatest,X=Wtest$X,Z=Wtest$Z,Y=Wtest$Y)
[Package EMSNM version 1.0 Index]