Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Skew normally distributed random numbers

by fglock (Vicar)
on Jan 28, 2005 at 13:05 UTC ( [id://425940]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Skew normally distributed random numbers
in thread Skew normally distributed random numbers

Actually, the AM says they want random numbers distributed normally, and that the range is specified as (mean - delta, mean + delta).

I believe they want to change the mean, and keep the delta.

  • Comment on Re^3: Skew normally distributed random numbers

Replies are listed 'Best First'.
Re^4: Skew normally distributed random numbers
by BrowserUk (Patriarch) on Jan 28, 2005 at 13:23 UTC

    Now you've said it, I can see that is a possible-- maybe, the more obviously correct interpretation--but if it is, I am confused.

    If you have a function that returns random numbers distibuted over the range x .. y, then--if the PRNG is any good--the mean will tend towards (x+y)/2.

    If you want a different mean with the same average delta, you just add the delta between the current and desired means to the low and high value of the range and your function will produce values in that range.

    I guess what I am saying is, if you want your numbers in one range, why produce them in another range and then add the delta to each one, rather than producing them in the desired range in the first place?


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.

      That's because his PRNG is not uniformly distributed. I try to show it in the ascii graphs below:

      Uniformly distributed: start avg end _____________ | | __| |__ Adding to start/end changes the avg: start avg end _____________ | | __| |__ Normally distributed: start avg end __________ / \ __/ \__ Changing only start/end may give strange results: start end ________ | \ __| \_______

        Okay. I got it now.

        You know what they say about pictures--I guess I should go back to my comic books.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.

        but... :)

        Most of the examples of skewed normal distributions I can find seem to show the same range, but with the peak (median?) offset to one side or the other. rather than the whole range translated sideways?

        Admittedly, most of the axis on the example curves aren't labelled, so it is hard to tell whether the range remains constant.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.
Re^4: Skew normally distributed random numbers
by Anonymous Monk on Jan 28, 2005 at 17:05 UTC
    I'm sorry, I (the OP) was unclear. I want to skew the mean away from the median, but keep the range (median - delta, median + delta).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://425940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found