Giter Site home page Giter Site logo

Stubborn function about hcubature.jl HOT 9 CLOSED

juliamath avatar juliamath commented on May 26, 2024
Stubborn function

from hcubature.jl.

Comments (9)

stevengj avatar stevengj commented on May 26, 2024 2

A simple grid is perfectly uniform. The purpose of Sobol sequences is to sample uniformly while lessening the curse of dimensionality. However, in HCubature we inevitably have the curse of dimensionality anyway, and we can only handle box subdomains.

(For a smooth function in low dimensions, HCubature should be much more efficient than any Monte–Carlo method.)

from hcubature.jl.

yakir12 avatar yakir12 commented on May 26, 2024 1

OK, I can confirm that, at least for me, it works! Thanks a lot!!!

from hcubature.jl.

giordano avatar giordano commented on May 26, 2024

Any ideas on what I can do?

Do you need to use this package or other packages are fine?

from hcubature.jl.

yakir12 avatar yakir12 commented on May 26, 2024

anything that works will be fine!

from hcubature.jl.

giordano avatar giordano commented on May 26, 2024

The divonne function in Cuba.jl has a peakfinder option to increase sampling around the given points. This is really useful when you have a function that is non-zero in very small regions and you know the position of those regions.

Honestly I've never used this feature in the julia interface but did use in the past directly with the C library, in these cases it's incredibly useful. Probably I can help you to do this in Cuba.jl as well.

Edit: probably the xgiven option should be sufficient, which is definitely easier to use

from hcubature.jl.

yakir12 avatar yakir12 commented on May 26, 2024

Great! I'll give it a solid try after lunch :)

from hcubature.jl.

yakir12 avatar yakir12 commented on May 26, 2024

Hmmm, seg fault:

julia> result = divonne((x, f) -> f = getsignal(x), 2, 1, nextra = 100)

signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0xffffffffffffffff)
Iterate at /home/yakir/.julia/packages/Cuba/6hxNB/deps/usr/lib/libcuba.so (unknown line)
Integrate at /home/yakir/.julia/packages/Cuba/6hxNB/deps/usr/lib/libcuba.so (unknown line)
llDivonne at /home/yakir/.julia/packages/Cuba/6hxNB/deps/usr/lib/libcuba.so (unknown line)
dointegrate! at /home/yakir/.julia/packages/Cuba/6hxNB/src/divonne.jl:52 [inlined]
dointegrate at /home/yakir/.julia/packages/Cuba/6hxNB/src/Cuba.jl:185 [inlined]
#divonne#2 at /home/yakir/.julia/packages/Cuba/6hxNB/src/divonne.jl:145
#divonne at ./none:0
unknown function (ip: 0x7f3051f69193)
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7f3070e53ab7)
unknown function (ip: 0x7f3070e53860)
unknown function (ip: 0x7f3070e54828)
unknown function (ip: 0x7f3070e54f04)
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f304a9c109f)
unknown function (ip: 0xb)
unknown function (ip: 0x7f3070e553cc)
unknown function (ip: 0x7f306f87206c)
jl_toplevel_eval_in at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7f306691c161)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7f3066a8d6ba)
unknown function (ip: 0x7f3066a8d92b)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7f306f858d8d)
unknown function (ip: 0xffffffffffffffff)
Allocations: 45132449 (Pool: 45126241; Big: 6208); GC: 91
Segmentation fault (core dumped)

from hcubature.jl.

stevengj avatar stevengj commented on May 26, 2024

I added an initdiv keyword option that should address this: it allows you to force the function to be sampled on a finer grid initially. e.g. try checking out the master branch and passing initdiv=10.

from hcubature.jl.

yakir12 avatar yakir12 commented on May 26, 2024

Doing it now. Exciting! Thank you. Alternatively, you could use your Sobol to improve from a simple grid to a more uniform sampling.

from hcubature.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.