# update_eta: Updata Eta In EMSNM: EM Algorithm for Sigmoid Normal Model

## Description

Updata eta in step t+1 with given data and coeffients estimated in step t.

## Usage

 ```1 2``` ```update_eta(fun, alphat, sigmat, etat, X, Y, Z, learning_rate_eta = 0.001, regular_parameter_eta = 0.001, max_iteration_eta = 10000) ```

## Arguments

 `fun` the function updata eta `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 `learning_rate_eta` learning rate of updating eta `regular_parameter_eta` regular value of updating eta by gradiant descending methond. `max_iteration_eta` maximal steps of eta interation to avoid unlimited looping.

## Value

 `alpha` alpha estimated in step t. `eta` eta estimated in step t+1. `sigma` sigma estimated in step t.

Linsui Deng

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19``` ```#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 update_eta thetaupdate_eta <- update_eta(fun=eta_gradient_fun,alphat=alphatest,sigmat=sigmatest, etat=etatest,X=Wtest\$X,Z=Wtest\$Z,Y=Wtest\$Y, learning_rate=0.1,regular_parameter=0.001,max_iteration=10000) ```

EMSNM documentation built on May 2, 2019, 1:41 p.m.