How do I create a list of $xy$ pairs of points where the $x$ points are evenly spaced between a given range with a specific step size, and the $y$ points are given by a function, but with some random noise added from a normal distribution with mean $= 0$ and standard deviation $= 1$ if I am given the function?
2 Answers
A standard way would probably be
Table[{x, f[x] + RandomVariate[NormalDistribution[]]}, {x, x0, x1, dx}]
for x
in steps of dx
in the range x0
to x1
, inclusive.
x = Range[1, 20, .3];
y = #^2 + RandomVariate[NormalDistribution[]] & /@ x;
Transpose[{x, y}]