Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI TRIGGER #184

Closed
wants to merge 6 commits into from
Closed

CI TRIGGER #184

wants to merge 6 commits into from

Conversation

ArnoStrouwen
Copy link
Member

No description provided.

@ArnoStrouwen
Copy link
Member Author

@ChrisRackauckas This package is in a bad shape. I cannot finish the CI improvements as is.
CI does not pass.
Test do not pass even more on windows.
Can you take a look at this or delegate it to somebody?

@ChrisRackauckas
Copy link
Member

@frankschae would you be able to take a look in the next week?

@frankschae
Copy link
Member

Yup, I'll have a look.

@frankschae
Copy link
Member

Are the Core1 tests actually running?

@ChrisRackauckas
Copy link
Member

Yes, it might be slowing down due to depwarns or something though. I suspect there must be one part of the test that got a lot slower.

@frankschae
Copy link
Member

Are the timestep_mean, timestep_meanvar, ... functions ok/updated for RAT3?

https://github.com/SciML/SciMLBase.jl/blob/master/src/ensemble/ensemble_analysis.jl

They seem to be the most likely origin for the remaining dep warnings in
https://github.com/SciML/DiffEqNoiseProcess.jl/blob/master/test/pcn_test.jl
https://github.com/SciML/DiffEqNoiseProcess.jl/blob/master/test/bridge_test.jl

@testset "Brownian Bridge" begin
    using DiffEqNoiseProcess, DiffEqBase, Test, Random, DiffEqBase.EnsembleAnalysis

    Random.seed!(100)
    W = BrownianBridge(0.0, 1.0, 0.0, 1.0, 0.0, 0.0)
    prob = NoiseProblem(W, (0.0, 1.0))
    ensemble_prob = EnsembleProblem(prob)
    @time sol = solve(ensemble_prob, dt = 0.1, trajectories = 100000)

    # Spot check the mean and the variance
    qs = 0:0.1:1
    for i in 2:10
        q = qs[i]
        @test (timestep_mean(sol, i), q, atol = 1e-2)
        @test (timestep_meanvar(sol, i)[2], (1 - q) * q, atol = 1e-2)
    end
    @test (timestep_mean(sol, 1)[1], 0.0, atol = 1e-16)
    @test (timestep_meanvar(sol, 1)[2], 0.0, atol = 1e-16)
    @test (timestep_mean(sol, 11)[1], 1.0, atol = 1e-16)
    @test (timestep_meanvar(sol, 11)[2], 0.0, atol = 1e-16)

    μ = 1.2
    σ = 2.2
    W = GeometricBrownianBridge(μ, σ, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0)
    prob = NoiseProblem(W, (0.0, 1.0))
    ensemble_prob = EnsembleProblem(prob)
    @time sol = solve(ensemble_prob, dt = 0.1, trajectories = 100)

    Random.seed!(100)
    r = 100 # should be independent of the rate, so make it crazy
    rate(u, p, t) = r
    W = CompoundPoissonBridge(rate, 0.0, 1.0, 0.0, 1.0)
    prob = NoiseProblem(W, (0.0, 1.0))
    ensemble_prob = EnsembleProblem(prob)
    @time sol = solve(ensemble_prob, dt = 0.1, trajectories = 100000)

    # Spot check the mean and the variance
    qs = 0:0.1:1
    for i in 2:10
        q = qs[i]
        # Mean and variance of binomial matches that of the Brownian bridge!
        @test (timestep_mean(sol, i), q, atol = 1e-2)
        @test (timestep_meanvar(sol, i)[2], (1 - q) * q, atol = 1e-2)
    end
    @test (timestep_mean(sol, 1)[1], 0.0, atol = 1e-16)
    @test (timestep_meanvar(sol, 1)[2], 0.0, atol = 1e-16)
    @test (timestep_mean(sol, 11)[1], 1.0, atol = 1e-16)
    @test (timestep_meanvar(sol, 11)[2], 0.0, atol = 1e-16)

    # check VBT distributional properties

    W = VirtualBrownianTree(0.0, 0.0; Wend = 1.0, tree_depth = 3)
    prob = NoiseProblem(W, (0.0, 1.0))
    function prob_func(prob, i, repeat)
        # to re-instantiate PRNG
        Wtmp = VirtualBrownianTree(0.0, 0.0; Wend = 1.0, tree_depth = 3)
        remake(prob, noise = Wtmp)
    end
    ensemble_prob = EnsembleProblem(prob, prob_func = prob_func)
    @time sol = solve(ensemble_prob, dt = 0.125, trajectories = 100000)

    # Spot check the mean and the variance
    qs = 0:0.125:1
    for i in 2:8
        q = qs[i]
        @test (timestep_mean(sol, i), q, atol = 1e-2)
        @test (timestep_meanvar(sol, i)[2], (1 - q) * q, atol = 1e-2)
    end
    @test (timestep_mean(sol, 1)[1], 0.0, atol = 1e-16)
    @test (timestep_meanvar(sol, 1)[2], 0.0, atol = 1e-16)
    @test (timestep_mean(sol, Int(2^(W.tree_depth) + 1))[1], W.W[end], atol = 1e-16)
    @test (timestep_meanvar(sol, Int(2^(W.tree_depth) + 1))[2], 0.0, atol = 1e-16)
end

@ChrisRackauckas
Copy link
Member

@AayushSabharwal

@AayushSabharwal
Copy link
Member

Looks like a one liner SciML/SciMLBase.jl#598

The only depwarns I get in the test above are from geometric_bm which is fixed in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants