# How to custom noise

**URL:** <https://discourse.julialang.org/t/how-to-custom-noise/71280>\
**Category:** Modelling & Simulations\
**Tags:** sde\
**Created:** [November 10, 2021, 6:58pm UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280 "2021-11-10T18:58:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frazze](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frazze/32/25142_2.png) [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Post date:** [November 10, 2021, 6:58pm UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/1 "2021-11-10T18:58:08Z")

</div>

Hi everyone,

I would like to study a SDE Problem with just additive white gaussian noise, but I would like also to control the value of the variance just to see what happen varying this value.

How can I do? How can build this kind of noise?

Thank you so much for the help.

Best regards

Francesco

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 11, 2021, 10:30am UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/2 "2021-11-11T10:30:11Z")

</div>

> [@Frazze](#):
>
> I would like to study a SDE Problem with just additive white gaussian noise, but I would like also to control the value of the variance just to see what happen varying this value.

Just multiply it by a value. Additive noise like `du .= a` for some parameter `a`.

---

<div class="post-metadata">

**Author:** ![Frazze](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frazze/32/25142_2.png) [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Post date:** [November 11, 2021, 10:58am UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/3 "2021-11-11T10:58:23Z")

</div>

Ok thank you. Just let me know if I’ve correctly understood:  
I define an SDE Pronlem as `SDEProblem(f,g,u0,tspan,p)` and now my g function has to be simply something like this:

```julia
function g(du,u,p,t)

 du .= a

  return nothing

end

```

Where a is the value of σ?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 11, 2021, 11:06am UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/4 "2021-11-11T11:06:32Z")

</div>

Yes, that would be additive Gaussian noise with a factor `a*dW`

---

<div class="post-metadata">

**Author:** ![Frazze](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frazze/32/25142_2.png) [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Post date:** [November 11, 2021, 11:25am UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/5 "2021-11-11T11:25:57Z")

</div>

Ok thank you so much! And if I would like to change the mean? (now is 0 by default I guess)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 11, 2021, 12:06pm UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/6 "2021-11-11T12:06:32Z")

</div>

That would just correspond to a value in the drift process.

---

<div class="post-metadata">

**Author:** ![Frazze](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frazze/32/25142_2.png) [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Post date:** [November 11, 2021, 12:20pm UTC](https://discourse.julialang.org/t/how-to-custom-noise/71280/7 "2021-11-11T12:20:32Z")

</div>

Ok, thank you so much for the help!
