# Error when passing long array of data to Turing.jl

**URL:** <https://discourse.julialang.org/t/error-when-passing-long-array-of-data-to-turing-jl/8098>\
**Category:** Statistics\
**Created:** [January 1, 2018, 10:05pm UTC](https://discourse.julialang.org/t/error-when-passing-long-array-of-data-to-turing-jl/8098 "2018-01-01T22:05:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricChameroy](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@EricChameroy](https://discourse.julialang.org/u/EricChameroy)\
**Post date:** [January 1, 2018, 10:05pm UTC](https://discourse.julialang.org/t/error-when-passing-long-array-of-data-to-turing-jl/8098/1 "2018-01-01T22:05:17Z")

</div>

Hi everyone,

I’m trying to pass an array of data through a model I’ve created using Turing.jl. The model looks like this:

@model howell1(height) = begin  
mu ~ Normal(178, 20)  
sigma ~ Uniform(0, 50)  
[height[i] ~ Normal(mu, sigma) for i = 1:length(height)]  
return mu, sigma  
end

The data I’m trying to pass to it is in a data frame column. I first tried to pass just the column, but apparently Turing.jl only works with arrays, not data arrays. After converting, the model seems to run, but generates the following error:

[Turing.WARNING]: Numerical error has been found in gradients.  
verifygrad(::Array{Float64,1}) at ad.jl:87

which usually repeats during a run. This happens when using HMC(1000, 0.1, 5), Gibbs(1000, PG(10, 2, :mu), HMC(2, 0.1, 5, :sigma)), HMCDA(1000, 0.15, 0.65), and NUTS(1000, 0.65). The argument values I got from the Turing.jl simple Gaussian demo.

Would anyone happen to know what I am doing wrong here?

Thanks.
