Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

MancPablo

Member

07-27-2016 09:51 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Afternoon All,

I am looking to add some normally distributed noise about a mean with a known standard deviation so I can run some Monte Carlo simulations using Labview. Fun times. Can anyone tell me why my histogram in the attached VI is not normally distributed?

Paul

"When I read about the horrors of drinking, I gave up reading"

ijustlovemath

Active Participant

07-27-2016 10:53 AM - edited 07-27-2016 10:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Because you're reading off the pdf value, not sampling from a normal distribution. Use "Continuous Random.vi" or "Continuous Inverse CDF.vi" with the Random Number (0,1) as your input to get a normally distributed rv.

There's also a Gaussian Noise signal generator you could use if you application involves waveform data.

07-28-2016 03:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I will have a look at those VIs. I think the issue isn't so much the PDF, it is that x is random rather than increasing in fixed steps. If I use a ramp between max min VI and feed that in, it produces a normal distribution.

"When I read about the horrors of drinking, I gave up reading"

ijustlovemath

Active Participant

07-28-2016 07:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Bob_Schor

Knight of NI

07-28-2016 07:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You don't want a __graph__ of a Normal Distribution, you want __samples__ drawn from a Normal Distribution. Consider LabVIEW's "Random number" generator, which returns a random number between 0 and 1. If you were to look at the PDF for the Uniform Distribution, it would be 1 for X between XMin and XMax, 0 otherwise.

Note that you can use the Central Limit Theorem to get an excellent (and pretty fast) approximation to a Normal Distribution with mean 0 and variance 1 -- simply sum 12 Uniform (0, 1) random numbers and subtract the expected mean (6). This is, in fact, the approximation that IBM distributed with their Scientific Software Package (Fortran) in the 60's.

Bob Schor

david.fox

Member

12-03-2020 01:14 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Bob,

That worked beautifully to create a normal distribution. Thanks for sharing. I tried Kudos but getting an error.

David Fox