Description Usage Arguments Details Value Author(s) Examples
Function for Newton-Raphson method
1 |
thseed |
Initial value for theta |
xiseed |
Initial value for xi |
Y |
data |
X |
data |
tol |
approximation tolerance |
Okay
list
E. A. Pena
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (thseed, xiseed, Y, X, tol = 10^(-5))
{
p = length(thseed)
kiter = 0
th0 = thseed
xi0 = xiseed
OK = FALSE
while (!OK) {
kiter = kiter + 1
est0 = c(th0, xi0)
out = UHFuncs(th0, xi0, Y, X)
U = out$U
H = out$H
UUt = out$UUt
Hinv = solve(H)
est1 = est0 - Hinv %*% U
th0 = est1[-(p + 1)]
xi0 = est1[(p + 1)]
dist = sqrt(sum((est1 - est0)^2))
if (dist < tol) {
OK = TRUE
}
}
XiCov = Hinv %*% UUt %*% t(Hinv)
return(list(kiter = kiter, th = th0, xi = xi0, U = U, H = H,
Hinv = Hinv, UUt = UUt, XiCov = XiCov))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.