{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/160","repository_url":"https://api.github.com/repos/JuliaStats/Klara.jl","labels_url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/160/comments","events_url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/160/events","html_url":"https://github.com/JuliaStats/Klara.jl/issues/160","id":236491167,"number":160,"title":"MethodError: Cannot `convert` an object of type Array{Float64,1} to an object of type Float64","user":{"login":"serdar-","id":6686283,"avatar_url":"https://avatars3.githubusercontent.com/u/6686283?v=3","gravatar_id":"","url":"https://api.github.com/users/serdar-","html_url":"https://github.com/serdar-","followers_url":"https://api.github.com/users/serdar-/followers","following_url":"https://api.github.com/users/serdar-/following{/other_user}","gists_url":"https://api.github.com/users/serdar-/gists{/gist_id}","starred_url":"https://api.github.com/users/serdar-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serdar-/subscriptions","organizations_url":"https://api.github.com/users/serdar-/orgs","repos_url":"https://api.github.com/users/serdar-/repos","events_url":"https://api.github.com/users/serdar-/events{/privacy}","received_events_url":"https://api.github.com/users/serdar-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-16T13:58:56Z","updated_at":"2017-06-17T14:49:20Z","closed_at":null,"body":"Dear all, \r\n\r\nI try to do sampling using MALA sampler but I get the following error:\r\n\r\n```\r\nMethodError: Cannot `convert` an object of type Array{Float64,1} to an object of type Float64\r\nThis may have arisen from a call to the constructor Float64(...),\r\nsince type constructors fall back to convert methods.\r\n\r\n in ##lowlevel_variable_method#610 at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\codegen.jl:67 [inlined]\r\n in ##closure#612(::Klara.BasicContMuvParameterState{Float64}) at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\variables/parameters\\parameters.jl:40\r\n in ##uptotarget_closures#614(::Klara.BasicContMuvParameterState{Float64}) at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\variables/parameters\\parameters.jl:89\r\n in initialize!(::Klara.BasicContMuvParameterState{Float64}, ::Klara.BasicContMuvParameter, ::Klara.MALA, ::Dict{Symbol,Any}) at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\samplers\\MALA.jl:68\r\n in Klara.BasicMCJob(::Klara.GenericModel, ::Int64, ::Klara.MALA, ::Klara.VanillaMCTuner, ::Klara.BasicMCRange{Int64}, ::Array{Klara.VariableState,1}, ::Dict{Symbol,Any}, ::Bool, ::Bool, ::Bool, ::Bool) at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\jobs\\BasicMCJob.jl:85\r\n in (::Core.#kw#Type)(::Array{Any,1}, ::Type{Klara.BasicMCJob}, ::Klara.GenericModel, ::Klara.MALA, ::Klara.BasicMCRange{Int64}, ::Array{Any,1}) at .\\<missing>:0\r\n in #BasicMCJob#188(::Int64, ::Klara.VanillaMCTuner, ::Dict{Symbol,Any}, ::Bool, ::Bool, ::Bool, ::Bool, ::Type{T}, ::Klara.GenericModel, ::Klara.MALA, ::Klara.BasicMCRange{Int64}, ::Dict{Symbol,Array{Float64,1}}) at C:\\Users\\Serdar\\.julia\\v0.5\\Klara\\src\\jobs\\BasicMCJob.jl:186\r\n in (::Core.#kw#Type)(::Array{Any,1}, ::Type{Klara.BasicMCJob}, ::Klara.GenericModel, ::Klara.MALA, ::Klara.BasicMCRange{Int64}, ::Dict{Symbol,Array{Float64,1}}) at .\\<missing>:0\r\n```\r\n\r\nHere is my code:\r\n```\r\nfl(v::Vector{Float64}) = S*v\r\n\r\ndf(v::Vector{Float64}) = sum(S,2)\r\n\r\nv_int = (vu-vl).*rand(95) - vu\r\n\r\nprob = BasicContMuvParameter(:prob, logtarget=fl,gradlogtarget=df)\r\n\r\nsamp_model = likelihood_model(prob, false)\r\n\r\nsampler = MALA(0.9)\r\n\r\nmcrange = BasicMCRange(nsteps=1000, burnin=100)\r\n\r\nv0 = Dict(:prob=>v_int)\r\n\r\noutopts = Dict{Symbol, Any}(:monitor=>[:value, :logtarget, :gradlogtarget], :diagnostics=>[:accept])\r\n\r\njob = BasicMCJob(samp_model, sampler, mcrange, v0, outopts=outopts)\r\n\r\nrun(job)\r\n```\r\n\r\nWhat could be the problem?"},"comment":{"url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/comments/309219508","html_url":"https://github.com/JuliaStats/Klara.jl/issues/160#issuecomment-309219508","issue_url":"https://api.github.com/repos/JuliaStats/Klara.jl/issues/160","id":309219508,"user":{"login":"scidom","id":2519036,"avatar_url":"https://avatars3.githubusercontent.com/u/2519036?v=3","gravatar_id":"","url":"https://api.github.com/users/scidom","html_url":"https://github.com/scidom","followers_url":"https://api.github.com/users/scidom/followers","following_url":"https://api.github.com/users/scidom/following{/other_user}","gists_url":"https://api.github.com/users/scidom/gists{/gist_id}","starred_url":"https://api.github.com/users/scidom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scidom/subscriptions","organizations_url":"https://api.github.com/users/scidom/orgs","repos_url":"https://api.github.com/users/scidom/repos","events_url":"https://api.github.com/users/scidom/events{/privacy}","received_events_url":"https://api.github.com/users/scidom/received_events","type":"User","site_admin":false},"created_at":"2017-06-17T14:49:20Z","updated_at":"2017-06-17T14:49:20Z","body":"I tried to run your code but `vu`, `vl` and `S` are not defined in your snippet. How did you define these? My first guess is that there may be a breakage depending on the version of Julia you are using, as the most recent ones have changed the way they handle arrays. You may send me your full snippet and I can check it, possibly with some delay, as I am back to my base from 11 July onwards."}}
{"actor":{"display_login":"scidom"}}