Formula: w(r) = sin(r/A)/(r/A) for |r| <= A pi, and 0 otherwise; w(0) = 1
References
Andrews (1974), A robust method for multiple linear regression, Technometrics 16:523-531. W(z) = sin(z/A)/(z/A) for |z| <= A pi with A = 1.339 is as documented by statsmodels' AndrewWave norm, the reference implementation.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Andrewswt(V)
#> $weight
#> [1] 0.90960003 0.66750881 0.34993396 0.05144347 0.00000000 0.00000000 0.00000000
#> [8] 0.00000000
#>
#> $rejected
#> [1] 4
#>
#> $A
#> [1] 1.339
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Andrews sine IRLS weight"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
