Ask Your Question

How to generate normal noise for a function

asked 2015-02-25 15:45:44 -0500

fehu gravatar image

updated 2015-02-26 07:15:48 -0500

sage: func(x) = x^2
sage: func_noise = func + normalvariate(0,1); func_noise
x |--> x^2 - 0.4436993396832335

How can one force the normalvariate to generate the number only on function evaluation?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-25 16:18:45 -0500

tmonteil gravatar image

From your description, it is not clear what do you want to do, but perhaps you should use Python function instead of symbolic function:

sage: func_noise = lambda x : x^2 + normalvariate(0,1)
sage: func_noise
<function <lambda> at 0xad99aa3c>
sage: func_noise(2)
sage: func_noise(2)
sage: func_noise(2)
sage: func_noise(2)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-02-25 15:45:44 -0500

Seen: 40 times

Last updated: Feb 26 '15