Learn R Programming

nlr (version 0.1-3)

nl.robhetroWM: Weighted M-estimate.

Description

Weighted M-estimate is robustified form of MLE, for nonlinear regression with heteroscedastic error, when variance is parameteric fucntion form. Both nonliner regression model parameter and variance function parameters compute simultanously by minizing the robustified objective function form.

Usage

nl.robhetroWM(formula, data, start = getInitial(formula, data), 
control = nlr.control(tolerance = 1e-04, minlanda = 1/2^10, 
maxiter = 50 * length(start), derivfree = T), robfunc, varmodel, tau = varmodel$par, ...)

Arguments

formula

nl.form object of the nonlinear function model.

data

list of data include responce and predictor.

start

list of parameter values of nonlinear model function (\(\theta\). in \(f(x,\theta)\)).

control

list of nlr.control for controling convergence criterions.

robfunc

nl.form object of robust function used for downgrading.

varmodel

nl.fomr object of variance function model for heteroscedastic variance.

tau

list of initial values for variance model function varmodel argument.

extra arguments to nonlinear regression model, heteroscedastic variance function, robust loss function or its tuning constants.

Value

return object nl.fitt.rgn for nonlienar regression with heterogeneous error.

parameters

nonlinear regression parameter estimate of \(\theta\).

correlation

of fited model.

form

nl.form object of called nonlinear regression model.

response

computed response.

predictor

computed (right side of formula) at estimated parameter with gradient and hessian attributes.

history

matrix of convergence history, collumns include: convergence index, parameters, minimized objective function, convergence criterion values, or other values. These values will be used in plot function in ploting history.

method

fittmethod object of method used for fitt.

data

list of called data.

sourcefnc

Object of class "callorNULL" source function called for fitt.

Fault

Fault object of error, if no error Fault number = 0 will return back.

htheta

robust loss likelihood value including gradient and hessain attributes.

rho

computed robust rho function, including gradient and hessain attributes.

ri

estimated residuals, including gradient and hessain attributes.

robform

nl.form object of robust loss rho function.

vm

covariance matrix, diagonal of variance model predicted values.

rm

cholesky decomposition of vm.

hetro

nl.fitt.rob object of fited variance odel:

  • parametersestimate of variance parameter \(\tau\)

  • formnl.form object of called varmodel.

  • predictorvariance model computed at estimated parameter, \(H(x;\hat\tau)\)

  • responsesample variance computed used as response variable.

others

$refvar reference variance. variance of zi's.

Details

For minimizing the objective function simultaneously for theta and tau, derivative free method Nelder-Mead is used.

References

Lim, C., Sen, P. K., Peddada, S. D. (2010). Statistical inference in nonlinear regression under heteroscedasticity. Sankhya B 72:202-218.

See Also

fittmethod, nl.form, nl.fitt.rob, nl.fitt.rgn

Examples

Run this code
# NOT RUN {
ntpstart=list(p1=.12,p2=6,p3=1,p4=33)
ntpstarttau=list(tau1=-.66,tau2=2,tau3=.04)
datalist=list(xr=ntp$dm.k,yr=ntp$cm.k)
datalist[[nlrobjvarmdls3[[2]]$independent]]<-ntp$dm.k
# ntp data fitt
# tolerance is set as 1e-3 for testing purposes
# is not accurate enough, user can increase it.
bb1 <- nl.robhetroWM(formula=nlrobj1[[15]],data=datalist,
start=ntpstart,robfunc=nl.robfuncs[["least square"]],
tau=ntpstarttau,varmodel=nlrobjvarmdls3[[2]],control=nlr.control(tolerance=1e-3,maxiter=1500))
bb1$parameters
#---------------- hampel -----------------
aa1 <- nl.robhetroWM(formula=nlrobj1[[15]],data=datalist,start=ntpstart,
robfunc=nl.robfuncs[["hampel"]],derivfree=T,
tau=ntpstarttau,varmodel=nlrobjvarmdls3[[2]],
control=nlr.control(tolerance=1e-3,maxiter=1500))#,delta=c(0.2,1,1,160,.2,1,.03))
aa1$parameters
# }

Run the code above in your browser using DataLab