Documentation for Bridge.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iff --git a/src/Bridge.jl b/src/Bridge.jl | |
| index 0653f9e..a633742 100644 | |
| --- a/src/Bridge.jl | |
| +++ b/src/Bridge.jl | |
| @@ -11,6 +11,7 @@ export thetamethod, thetamethod!, thetainnovations!, thetainnovations, heun, heu | |
| export ullikelihood, ullikelihoodtrapez, uinnovations!, ubridge | |
| using Distributions | |
| +using EllipsisNotation | |
| import Base.rand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Base: start, next, done, length | |
| type RandFromRangeDown | |
| k::Int | |
| mask::Int | |
| end | |
| RandFromRangeDown(k) = RandFromRangeDown(k,2^16-1) | |
| _rnd(::RandFromRangeDown) = Base.Random.rand_ui52_raw(Base.Random.GLOBAL_RNG) | |
| mm(n,k) = div(n,k)*k | |
| function start(rfr::RandFromRangeDown) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Base.show(io::IO, ::MIME"text/plain", pwm::MyT) | |
| # ... | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function has_path(g::AbstractGraph, u::Integer, v::Integer; exclude_vertices::AbstractVector=Vector{eltype(g)}()) | |
| T = eltype(g) | |
| seen = falses(nv(g)) | |
| next = Vector{T}() | |
| push!(next, u) | |
| excludeset = Set(exclude_vertices) | |
| while !isempty(next) | |
| src = shift!(next) #Get first element | |
| src in excludeset && continue | |
| vertexneighbors = neighbors(g, src) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Base.Iterators | |
| import Base: done, next, start, length, eltype, iteratorsize, HasShape, HasLength | |
| struct UnshapedIterator{I} | |
| it::I | |
| UnshapedIterator{I}(it::I, a::HasShape) = new{I}(it) | |
| UnshapedIterator{I}(it::I, a::HasLength) = new{I}(it) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "ArgumentError" | |
| "AssertionError" | |
| "Base.DNSError" No documentation found. | |
| "Base.Distributed.BatchProcessingError" No documentation found. | |
| "Base.LibGit2.Error.GitError" No documentation found. | |
| "Base.LinAlg.ARPACKException" No documentation found. | |
| "Base.LinAlg.LAPACKException" No documentation found. | |
| "Base.LinAlg.PosDefException" No documentation found. | |
| "Base.LinAlg.RankDeficientException" No documentation found. | |
| "Base.LinAlg.SingularException" No documentation found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkTools | |
| using StaticArrays | |
| function kernelrk(f, t, y, dt) | |
| k1 = f(t, y) | |
| k2 = f(t + 1/2*dt, y + 1/2*dt*k1) | |
| k3 = f(t + 3/4*dt, y + 3/4*dt*k2) | |
| y! = y + dt*(2/9*k1 + 1/3*k2 + 4/9*k3) | |
| # k4 = f(t + dt, y‘) | |
| # zn1 = y + dt*(7/24*k1 + 1/4*k2 + 1/3*k3 + 1/8*k4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Bridge, Distributions, StaticArrays | |
| using Base.Test | |
| """ | |
| kernelrk(f, t, y, dt, P) | |
| Ralston (1965) update (order 3 step of the Bogacki–Shampine 1989 method) | |
| to solve ``y(t + dt) - y(t) = \\int_t^{t+dt} f(s, y(s)) ds``. | |
| """ | |
| function kernelrk(f, t, y, dt, P) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Bridge, StaticArrays | |
| Ps = [Wiener{Float64}(), Wiener{Complex{Float64}}(), Wiener{SVector{2,Float64}}()] | |
| Xs = [sample([0.0, 0.5, 1.0], P) for P in Ps] | |