# Error with bunchkaufman factorization in Turing.jl

**URL:** https://discourse.julialang.org/t/error-with-bunchkaufman-factorization-in-turing-jl/88174
**Category:** Probabilistic Programming
**Tags:** linearalgebra, error, turing
**Created:** [October 3, 2022, 5:58pm UTC](https://discourse.julialang.org/t/error-with-bunchkaufman-factorization-in-turing-jl/88174 "2022-10-03T17:58:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [October 3, 2022, 5:58pm UTC](https://discourse.julialang.org/t/error-with-bunchkaufman-factorization-in-turing-jl/88174/1 "2022-10-03T17:58:21Z")

</div>

I have a Turing.jl model that makes use of the `LinearAlgebra.bunchkaufman` factorization routine. Whenever I try to sample from the posterior, I get the following error message saying that there is no method available with `ForwardDiff.Dual`:

```julia
ERROR: TaskFailedException

    nested task error: TaskFailedException
    
        nested task error: MethodError: no method matching bunchkaufman!(::LinearAlgebra.Symmetric{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}}, ::Bool; check=false)
        Closest candidates are:
          bunchkaufman!(::LinearAlgebra.Hermitian{T, S} where {T<:Union{ComplexF32, ComplexF64}, S<:StridedMatrix{T}}, ::Bool; check) at ~/Desktop/julia-1.8.2/share/julia/stdlib/v1.8/LinearAlgebra/src/bunchkaufman.jl:105
          bunchkaufman!(::Union{LinearAlgebra.Hermitian{T, S}, LinearAlgebra.Symmetric{T, S}, LinearAlgebra.Symmetric{Complex{T}, S}} where {T<:Union{Float32, Float64}, S<:(StridedMatrix{T} where T)}, ::Bool; check) at ~/Desktop/julia-1.8.2/share/julia/stdlib/v1.8/LinearAlgebra/src/bunchkaufman.jl:99
          bunchkaufman!(::StridedMatrix{var"#s881"} where var"#s881"<:Union{Float32, Float64, ComplexF32, ComplexF64}, ::Bool; check) at ~/Desktop/julia-1.8.2/share/julia/stdlib/v1.8/LinearAlgebra/src/bunchkaufman.jl:111
          ...
        Stacktrace:
          [1] bunchkaufman(A::LinearAlgebra.Symmetric{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}}, rook::Bool; check::Bool)
            @ LinearAlgebra ~/Desktop/julia-1.8.2/share/julia/stdlib/v1.8/LinearAlgebra/src/bunchkaufman.jl:199

```

Where should this method be added? Is it a missing method of DynamicPPL.jl or an issue with the LinearAlgebra implementation? Appreciate any help.
