fitEB: fitSTEBLUP

Description Usage Arguments Examples

View source: R/fitEB.R

Description

Wrapper function for the estimation of a FH model. Uses the function fitFH provided by Sample Deliverable 22: Software on Small Area Estimation

Usage

1
2
3
4
5
fitEB(formula, dat, beta, sigma, rho,
  sigmaSamplingError = seSigmaClosure(nDomains, nTime)(),
  nDomains = getNDomains(dat), nTime = getNTime(dat),
  w0 = w0Matrix(nDomains), w = w0/rowSums(w0), tol = 0.001,
  method = "Nelder-Mead", maxIter = 500)

Arguments

formula

formula for the fixed effects part

dat

data with dependent and independent variable as they are used in formula. The data should contain a variable Domain and Time indicating the domain and time period for each observation respectively - only the last time period will be used for estimation and prediction.

beta,

sigma, rho start values for the parameters - not needed in the call to fitFH

sigmaSamplingError

True variances for the sampling errors

nDomains

the number of domains. Will be determined by default, see dat - not needed in the call to fitFH

nTime

the number of time periods. Will be determined by default, see dat - not needed in the call to fitFH

w0

proximity matrix - not needed in the call to fitFH

w

at the moment row-standardized proximity matrix - not needed in the call to fitFH

tol

numerical tolerance for algorithm - not needed in the call to fitFH

method

method used by the function optim - not needed in the call to fitFH

maxIter

maximal number of iterations

Examples

1
2
3
4
5
6
7
require(spatioTemporalData); require(SAE)
set.seed(3)
setup <- simSetupMarhuenda(nDomains=30, nTime=5, sarCorr=0.5, arCorr=0.5, n = 200)
output <- simRunMarhuenda(setup)
dat <- slot(output[[1]], "data")[[1]]
result <- fitEB(y~x, dat, c(0,1), c(1,1), c(0.5,0.5))
#summary(result)

wahani/SAE documentation built on May 3, 2019, 7:37 p.m.

Related to fitEB in wahani/SAE...