# Help! How to give multiplicative error in turing or DifferentialEvolutionMCMC?

**URL:** https://discourse.julialang.org/t/help-how-to-give-multiplicative-error-in-turing-or-differentialevolutionmcmc/96378
**Category:** New to Julia
**Tags:** question, turing
**Created:** [March 21, 2023, 9:05am UTC](https://discourse.julialang.org/t/help-how-to-give-multiplicative-error-in-turing-or-differentialevolutionmcmc/96378 "2023-03-21T09:05:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)
#### Post date: [March 21, 2023, 9:05am UTC](https://discourse.julialang.org/t/help-how-to-give-multiplicative-error-in-turing-or-differentialevolutionmcmc/96378/1 "2023-03-21T09:05:58Z")

</div>

I used to work in r and now i’m switching to Julia. In r, I was using DifferentialEvolution package where its very straight forward if you want to give multiplicative or additive noise with respect to data as shown:

likelihood1 = sum(dnorm(x= prediction, mean= data, sd=(data+0.01)\*SD,log=TRUE))

I tried same logic in DiffenrentialEvolutionMCMC in julia as it has a direct loglikelihood function but its not working.

for j in 1:3  
for i in 1:6

```
   LL += logpdf(MvNormal(predicted[:,i], data[j][:,i] .*σ ), data[j][:,i])
  
  end
end

```

Also I’m trying in turing.jl

for j in 1:3  
for i in 1:6

```
   data[j][:,i] ~ MvNormal(predicted[:,i], data[j][:,i] .*σ)
 

  end  
end

```

I’m pretty sure there is something basic i’m missing here… It will be really nice if someone can help… Thank You 🙂
