2
$\begingroup$

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?

$\endgroup$

2 Answers 2

3
$\begingroup$

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.

$\endgroup$
2
$\begingroup$
x = Range[1, 20, .3];

y = #^2 + RandomVariate[NormalDistribution[]] & /@ x;

Transpose[{x, y}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.