@@ -9,7 +9,7 @@ Estimate the parameter `estimator(x)` for each subsample of `x`, systematically
99omitting each index one at a time. The result is a vector of length `length(x)-1`
1010of parameter estimates.
1111"""
12- function leaveoneout {T<:Real} (estimator:: Function , x:: AbstractVector{T } )
12+ function leaveoneout (estimator:: Function , x:: AbstractVector{<:Real } )
1313 length (x) > 1 || throw (ArgumentError (" The sample must have size > 1" ))
1414 inds = eachindex (x)
1515 return [estimator (x[filter (j -> j != i, inds)]) for i in inds]
2222Compute the jackknife estimate of the variance of `estimator`, which is given as a
2323function that computes a point estimate when passed a real-valued vector `x`.
2424"""
25- function variance {T<:Real} (estimator:: Function , x:: AbstractVector{T } )
25+ function variance (estimator:: Function , x:: AbstractVector{<:Real } )
2626 θ = leaveoneout (estimator, x)
2727 n = length (x)
2828 return Base. var (θ) * (n - 1 )^ 2 / n
3535Compute the jackknife estimate of the bias of `estimator`, which is given as a
3636function that computes a point estimate when passed a real-valued vector `x`.
3737"""
38- function bias {T<:Real} (estimator:: Function , x:: AbstractVector{T } )
38+ function bias (estimator:: Function , x:: AbstractVector{<:Real } )
3939 θ = leaveoneout (estimator, x)
4040 return (length (x) - 1 ) * (mean (θ) - estimator (x))
4141end
4646
4747Compute the bias-corrected jackknife estimate of the parameter `estimator(x)`.
4848"""
49- function estimate {T<:Real} (estimator:: Function , x:: AbstractVector{T } )
49+ function estimate (estimator:: Function , x:: AbstractVector{<:Real } )
5050 θ = leaveoneout (estimator, x)
5151 n = length (x)
5252 return n * estimator (x) - (n - 1 ) * mean (θ)
0 commit comments