@@ -139,11 +139,11 @@ method(print, influence_func_estimate) <- function(x, ...) {
139139# x + y
140140method(`+` , list (influence_func_estimate , influence_func_estimate )) <- function (e1 , e2 ) {
141141 check_same(e1 , e2 )
142- influence_func_estimate(e1 @ x + e2 @ x , e1 @ eif + e2 @ eif , e1 @ weights , e1 @ id )
142+ influence_func_estimate(e1 @ x + e2 @ x , e1 @ eif + e2 @ eif , e1 @ weights , e1 @ id , max( e1 @ critical_value , e2 @ critical_value ) )
143143}
144144
145145method(`+` , list (influence_func_estimate , class_numeric )) <- function (e1 , e2 ) {
146- influence_func_estimate(e1 @ x + e2 , e1 @ eif , e1 @ weights , e1 @ id )
146+ influence_func_estimate(e1 @ x + e2 , e1 @ eif , e1 @ weights , e1 @ id , e1 @ critical_value )
147147}
148148
149149# Delegate to ife + scalar since addition is commutative
@@ -152,15 +152,15 @@ method(`+`, list(class_numeric, influence_func_estimate)) <- function(e1, e2) e2
152152# x - y
153153method(`-` , list (influence_func_estimate , influence_func_estimate )) <- function (e1 , e2 ) {
154154 check_same(e1 , e2 )
155- influence_func_estimate(e1 @ x - e2 @ x , e1 @ eif - e2 @ eif , e1 @ weights , e1 @ id )
155+ influence_func_estimate(e1 @ x - e2 @ x , e1 @ eif - e2 @ eif , e1 @ weights , e1 @ id , max( e1 @ critical_value , e2 @ critical_value ) )
156156}
157157
158158method(`-` , list (influence_func_estimate , class_numeric )) <- function (e1 , e2 ) {
159- influence_func_estimate(e1 @ x - e2 , e1 @ eif , e1 @ weights , e1 @ id )
159+ influence_func_estimate(e1 @ x - e2 , e1 @ eif , e1 @ weights , e1 @ id , e1 @ critical_value )
160160}
161161
162162method(`-` , list (class_numeric , influence_func_estimate )) <- function (e1 , e2 ) {
163- influence_func_estimate(e1 - e2 @ x , - e2 @ eif , e2 @ weights , e2 @ id )
163+ influence_func_estimate(e1 - e2 @ x , - e2 @ eif , e2 @ weights , e2 @ id , e2 @ critical_value )
164164}
165165
166166# x / y
@@ -170,36 +170,36 @@ method(`/`, list(influence_func_estimate, influence_func_estimate)) <- function(
170170 stop(" Division by zero: denominator estimate is zero" , call. = FALSE )
171171 }
172172 eif <- (e1 @ eif / e2 @ x ) - ((e2 @ eif / e2 @ x ^ 2 ) * e1 @ x )
173- influence_func_estimate(e1 @ x / e2 @ x , eif , e1 @ weights , e1 @ id )
173+ influence_func_estimate(e1 @ x / e2 @ x , eif , e1 @ weights , e1 @ id , max( e1 @ critical_value , e2 @ critical_value ) )
174174}
175175
176176method(`/` , list (class_numeric , influence_func_estimate )) <- function (e1 , e2 ) {
177177 if (abs(e2 @ x ) < .Machine $ double.eps ) {
178178 stop(" Division by zero: denominator estimate is zero" , call. = FALSE )
179179 }
180- influence_func_estimate(e1 / e2 @ x , - e1 / e2 @ x ^ 2 * e2 @ eif , e2 @ weights , e2 @ id )
180+ influence_func_estimate(e1 / e2 @ x , - e1 / e2 @ x ^ 2 * e2 @ eif , e2 @ weights , e2 @ id , e2 @ critical_value )
181181}
182182
183183method(`/` , list (influence_func_estimate , class_numeric )) <- function (e1 , e2 ) {
184184 if (abs(e2 ) < .Machine $ double.eps ) {
185185 stop(" Division by zero: denominator is zero" , call. = FALSE )
186186 }
187- influence_func_estimate(e1 @ x / e2 , 1 / e2 * e1 @ eif , e1 @ weights , e1 @ id )
187+ influence_func_estimate(e1 @ x / e2 , 1 / e2 * e1 @ eif , e1 @ weights , e1 @ id , e1 @ critical_value )
188188}
189189
190190# x * y
191191method(`*` , list (influence_func_estimate , influence_func_estimate )) <- function (e1 , e2 ) {
192192 check_same(e1 , e2 )
193- influence_func_estimate(e1 @ x * e2 @ x , e2 @ x * e1 @ eif + e1 @ x * e2 @ eif , e1 @ weights , e1 @ id )
193+ influence_func_estimate(e1 @ x * e2 @ x , e2 @ x * e1 @ eif + e1 @ x * e2 @ eif , e1 @ weights , e1 @ id , max( e1 @ critical_value , e2 @ critical_value ) )
194194}
195195
196196method(`*` , list (class_numeric , influence_func_estimate )) <- function (e1 , e2 ) {
197- influence_func_estimate(e1 * e2 @ x , e1 * e2 @ eif , e2 @ weights , e2 @ id )
197+ influence_func_estimate(e1 * e2 @ x , e1 * e2 @ eif , e2 @ weights , e2 @ id , e2 @ critical_value )
198198}
199199
200200# x^n
201201method(`^` , list (influence_func_estimate , class_numeric )) <- function (e1 , e2 ) {
202- influence_func_estimate(e1 @ x ^ e2 , e2 * e1 @ x ^ (e2 - 1 ) * e1 @ eif , e1 @ weights , e1 @ id )
202+ influence_func_estimate(e1 @ x ^ e2 , e2 * e1 @ x ^ (e2 - 1 ) * e1 @ eif , e1 @ weights , e1 @ id , e1 @ critical_value )
203203}
204204
205205# Delegate to scalar * ife since multiplication is commutative
@@ -210,10 +210,10 @@ method(log, influence_func_estimate) <- function(x, base) {
210210 if (x @ x < = 0 ) {
211211 stop(" log() requires positive values: estimate is " , x @ x , call. = FALSE )
212212 }
213- influence_func_estimate(log(x @ x ), x @ eif / x @ x , x @ weights , x @ id )
213+ influence_func_estimate(log(x @ x ), x @ eif / x @ x , x @ weights , x @ id , x @ critical_value )
214214}
215215
216216# exp(x)
217217method(exp , influence_func_estimate ) <- function (x ) {
218- influence_func_estimate(exp(x @ x ), exp(x @ x ) * x @ eif , x @ weights , x @ id )
218+ influence_func_estimate(exp(x @ x ), exp(x @ x ) * x @ eif , x @ weights , x @ id , x @ critical_value )
219219}
0 commit comments