LICurvature.default: Assement on Local Influence in Case-Weight for the Linear...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/LICurvature.R

Description

This Package presents a general method for assessing the local influence of minor perturbations of ase-weight for the linear regression models. The method relies on a well-behaved likelihood and certain elementary ideas from differential geometry, and seems to provide a relatively simple, unified approach for handling a variety of problems. A distinguishing feature of this method is its use of log-likelihood contours to gauge influence. Although this Package is concerned primarily with local influence, some discussion of assessing global influence, which is a significantly more difficult problem. We use geometric normal curvatures to characterize the behaviour of an influence graph around omega (Generally, omega can reflect any well-defined perturbation scheme and thus is not restricted to be a collection of case weights.),although the essential results can be obtained by using less descriptive We used it in case-Weight for the linear regression models, also recommended a general reference for deciding whether there is notable local sensitivity or not

Usage

1
2
## Default S3 method:
LICurvature(ini = NA,X,Xstar,y,n,p, ...)

Arguments

ini

Initial values

X

Covariate matrix

Xstar

Design matrix

y

Continuous response

n

Sample size

p

The number of covariates

...

Other arguments

Details

Models for LICurvature are specified symbolically. A typical model has the form response ~ terms where response is the (numeric) continuous vector and terms is a series of terms which specify a linear predictor for response.

Value

lmax

Eign vector

Clmax

Normal curvatures for case weight for linear regression model

Note

Supportted by Shahid Beheshti University

Author(s)

Bahrami Samani and ParsaMaram

References

Cook, R. D. (1986). Assessment of local influence (with discussion). J. Roy. Statist. Soc. Ser. B 48: 133-169.

See Also

nlminb,eigen

Examples

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 function(ini = NA, X,Xstar, y,n,p,...)
{
f <- function(ini = NA, X,Xstar, y,n,p) {
p=length(X[1,])
n = nrow(X)
my = matrix(0,n,p)
l=vector("numeric",n)
l=as.vector(l)
y <- as.vector(y)
ini <- as.vector(ini)
Xstar=cbind(1,X)
Xstar <- as.matrix(Xstar)
muy=numeric(n)
for(i in 1:n){
for(j in 1:p){
my[i,j]=ini[0:p][[j]]*Xstar[i, ][[j]]
}}
for (i in 1:n) {
muy[i] <- sum(my[i,])

l[i] <-  log(dnorm(y[i], muy[i],ini[p+1]))
}

Like=sum(l)
;-Like
}
ini=c(0,rep(1,p))
ml = nlminb(ini, f, X = X,Xstar=Xstar, y=y,n=n,p=p, lower = c(rep(-Inf,
p), 0), upper = c(rep(Inf,p+1)), hessian = T)
phat=as.matrix(ml$par[0:p+1])
yhat=Xstar
res=y-yhat
res=as.vector(res)
E=diag(res)
Px=Xstar
esq=(res)^2
esq=matrix(esq,n,1)
z1=t(Xstar)
z2=t(esq)/2*(ml$par[p+1])^2
Delta=rbind(z1,z2)
v1=t(Xstar)
v2=n/2*(ml$par[p+1])^2
z=matrix(rep(0),(p+1))
m1=rbind(v1,t(z))
m2=rbind(z,v2)
Lzegond=(-1)*cbind(m1,m2)
Fzegond=t(Delta)
eig=eigen(Fzegond)
eigenval=eig$values
maxval=max(eigenval)
eigvec=eig$vectors
maxvec=eigvec[,which((eigenval)==maxval)]
Q=t(maxvec)
C=2*abs(Q)/(ml$par[p+1])

r <- list(call = ml, lmax=maxvec,Cmax=C)
 r$call <- match.call()
    class(r) <- "LICurvature"
    r

}

LICurvature documentation built on May 30, 2017, 4:18 a.m.