Skip to content

Commit

Permalink
Merge #21
Browse files Browse the repository at this point in the history
21: Updates r=devmotion a=devmotion



Co-authored-by: David Widmann <dev+git@devmotion.de>
  • Loading branch information
bors[bot] and devmotion committed May 10, 2020
2 parents 65fd093 + 25e4bb9 commit a3475a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Expand Up @@ -7,18 +7,18 @@ version = "0.4.0"
CalibrationErrors = "33913031-fe46-5864-950f-100836f47845"
HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
CalibrationErrors = "0.5"
HypothesisTests = "0.8, 0.9, 0.10"
Parameters = "0.12"
StatsBase = "0.32, 0.33"
StatsFuns = "0.8, 0.9"
UnPack = "0.1, 1"
julia = "1.1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/CalibrationTests.jl
Expand Up @@ -2,7 +2,7 @@ module CalibrationTests

using CalibrationErrors
using HypothesisTests
using Parameters
using UnPack
using StatsBase
using StatsFuns

Expand Down
5 changes: 3 additions & 2 deletions src/skce/asymptotic_block.jl
Expand Up @@ -35,6 +35,7 @@ function AsymptoticBlockSKCETest(kernel::Kernel, blocksize::Int, data...)

# compute number of blocks
nblocks = nsamples ÷ blocksize
nblocks 2 || error("there must be at least 2 blocks")

# evaluate U-statistic of the first block
istart = 1
Expand All @@ -43,7 +44,7 @@ function AsymptoticBlockSKCETest(kernel::Kernel, blocksize::Int, data...)

# initialize the estimate and the sum of squares
estimate = x / 1
S = zero(x)
S = zero(estimate)^2

# for all other blocks
for b in 2:nblocks
Expand All @@ -60,7 +61,7 @@ function AsymptoticBlockSKCETest(kernel::Kernel, blocksize::Int, data...)
end

# compute standard error and z-statistic
stderr = sqrt(S) / nblocks
stderr = sqrt(S / (nblocks * (nblocks - 1)))
z = estimate / stderr

return AsymptoticBlockSKCETest(kernel, blocksize, nblocks, estimate, stderr, z)
Expand Down

0 comments on commit a3475a7

Please sign in to comment.