Code Monkey home page Code Monkey logo

Comments (4)

chenwilliam77 avatar chenwilliam77 commented on May 15, 2024

Hi giorgiomas,

Thank you for catching this bug. Unless you want to submit a pull request, I will try to fix this error next week and let you know what I did to fix it since I don't anticipate a new release will be available until at least a month from now.

Best,

William

from dsge.jl.

giorgiomas avatar giorgiomas commented on May 15, 2024

Hi William,

thank you for the prompt answer! Actually, I'm quite new to Julia, so I don't think I'm going to submit a pull request. I mean, I've already written another function in place of generate_param_blocks that works, but I'm pretty sure that there are better ways than how I did it, codewise speaking.
I just meant to be sure I was not wrong, and to let you know in case.

Thank you anyway,

Giorgio

from dsge.jl.

chenwilliam77 avatar chenwilliam77 commented on May 15, 2024

Here's the fix I used:

Instead of

free_para_inds = findall([!θ.fixed for θ in parameters])
n_free_para    = length(free_para_inds)
n_params       = length(parameters)
blocks_all     = SMC.generate_param_blocks(n_free_para, n_param_blocks)

a fix would be

free_para_inds = findall([!θ.fixed for θ in parameters])
n_params       = length(parameters)
if n_param_blocks == 1
    blocks_all = Vector{Int}[free_para_inds]
else
    n_free_para    = length(free_para_inds)
    blocks_all      = SMC.generate_free_blocks(n_free_para, n_param_blocks)
    for block_a in blocks_all
        sort!(block_a)
    end
end

from dsge.jl.

giorgiomas avatar giorgiomas commented on May 15, 2024

Thanks!

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