Giter VIP home page Giter VIP logo

Comments (4)

CharlesRSmith44 avatar CharlesRSmith44 commented on August 22, 2024

I find that the code also takes a really long time to run using a multvariate normal distribution


#User Input
N = 7
tol = 2
alg = HCubatureJL()

# Setting up problem
reltol_val = 10.0^(-tol)
abstol_val = 10.0^(-tol)

means = rand(N)
vars = Diagonal(abs.(rand(N,N)))
d = MvNormal(means , vars)
m(x , p) = pdf(d, x) .* x
prob = QuadratureProblem(m, -Inf*ones(N) , Inf*ones(N))
time_start = time()
mem_usage = @allocated sol_mean = Quadrature.solve(prob,alg,reltol=1e-2,abstol=1e-2)
total_mem = mem_usage/1000/2^20

display(sol_mean)
display(means)
'''

from integrals.jl.

ChrisRackauckas avatar ChrisRackauckas commented on August 22, 2024

Methods like HCubature grow exponentially with dimension. CubaVegas and CubaSUAVE have better properties at higher dimensions.

from integrals.jl.

CharlesRSmith44 avatar CharlesRSmith44 commented on August 22, 2024

I'm finding that with CubaSUAVE and CubaVegas that for large N (N > 10) the solutions are inaccurate. Is this expected behavior or am I doing something wrong?


#User Input
N = 15
tol = 3 #even if I try tol = 10 or 15 still inaccurate.  
alg = CubaSUAVE()

# Setting up problem
reltol_val = 10.0^(-tol)
abstol_val = 10.0^(-tol)

means = rand(N)
vars = Diagonal(abs.(rand(N,N)))
d = MvNormal(means , vars)
m(x , p) = pdf(d, x) .* x

function f_normal(x,p)
    sum(pdf(d,x) .* x)
end

prob = QuadratureProblem(f_normal, -Inf*ones(N) , Inf*ones(N), nout=1)
time_start = time()
mem_usage = @allocated sol_mean = Quadrature.solve(prob,alg,reltol=reltol_val,abstol=abstol_val)
total_mem = mem_usage/1000/2^20

display(sol_mean.u)
display(sum(means))

from integrals.jl.

ChrisRackauckas avatar ChrisRackauckas commented on August 22, 2024

You might need to increase maxiters.

from integrals.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.