How to simulate a random sample with  Poisson distribution?

Poisson, beta, gammar, and so on,
How to get a random sample from such specific distribution in java?

did you check colt?

Similar Messages

  • How to make a random generator with a max and a minimum

    hello
    can anybody telle me how to make a random generator for numbers with a maximum and minimum input
    thanks in advance

    Hi suske,
    If you want a random day for a given month, this is how I would do it.
    Hope this helps,
    -D
    Message Edited by Darren on 02-02-2006 01:35 PM
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    Days_per_month.jpg ‏32 KB

  • How to simulate a pll circuit with NI MULTISIM

    I want to simulate a PLL circuit with Multisim 13.0 before building it on the real NI ELVIS 2 breadboard. I want to see what results I should be expecting first, but I couldn't find a 74HC4046 chip in the Multisim software. Does anyone know how I can find the 74hc4046 chip in that software?

    Hi there,
    When a component is not available in the Multisim Database, you can try to find a SPICE model for the component and then use the Component Wizard (Tools menu) to create a custom component. Click here to learn more about component creation.
    Usually, SPICE models can be found in the manufacturer's website. I did a quick search but could not find a model for the 74HC4046.
    In Multisim, there is a generic PLL that you could use. It can be found in the Mixed Group, MIXED_VIRTUAL family.
    Regards,
    Fernando D.
    National Instruments

  • How to select a random row with for update?

    Hi,
    I have a package that needs to assign a random, reusable number (ID) that is not currently being used - to a procedure.
    I'm trying to simulate a pool of numbers (IDs) using a table that has an ID and IS_USED columns.
    How do I do:
    select a random ID (random row)
    from pool_table
    where IS_USED is 0 (not taken)
    FOR UPDATEThe for update is to lock the row from being taken by another process calling the package.
    OR:
    Can I simulate a pool of numbers with a different object (not a table)?
    I need the numbers to be coherent between sessions (thus package variables will not work) and only one session uses the same ID at any given time. When it finishes the number becomes available for further runs.
    Thanks.
    Edited by: Pyrocks on Nov 7, 2010 10:45 AM

    This works on Oracle 11g (probably on 10g too, but I haven't tested):
    CREATE OR REPLACE PACKAGE REUSABLE_RANDOM_NUMBERS
    IS
      FUNCTION GET_NUMBER RETURN NUMBER;
    END REUSABLE_RANDOM_NUMBERS;
    create or replace
    PACKAGE BODY REUSABLE_RANDOM_NUMBERS
    IS
      TYPE NUM_TABLE_TYPE IS TABLE OF CHAR INDEX BY PLS_INTEGER;
      MIN_VALUE CONSTANT PLS_INTEGER := 0;
      max_value CONSTANT PLS_INTEGER := 10;
      NUM_TABLE NUM_TABLE_TYPE;
      FUNCTION GET_NUMBER RETURN NUMBER
      IS
        num PLS_INTEGER;
      BEGIN
        FOR I IN 1 .. 100 LOOP
           NUM := DBMS_RANDOM.VALUE( min_value, max_value );
           IF NOT NUM_TABLE.EXISTS( NUM ) THEN
              NUM_TABLE( NUM ) := 'X';
              RETURN NUM;
           END IF;
        END LOOP;
        FOR I IN MIN_VALUE .. MAX_VALUE LOOP
          IF NOT NUM_TABLE.EXISTS( i ) THEN
              NUM_TABLE( i ) := 'X';
              RETURN i;
           END IF;
        END LOOP;
        RAISE_APPLICATION_ERROR( -20991, 'All possible values have ben used, cannot assign a new one' );
      END;
    END REUSABLE_RANDOM_NUMBERS;
    SELECT REUSABLE_RANDOM_NUMBERS.GET_NUMBER
    FROM DUAL
    connect by level <= 11;
    GET_NUMBER            
    3                     
    4                     
    6                     
    2                     
    1                     
    7                     
    8                     
    0                     
    9                     
    5                     
    10                    
    11 rows selected
    SELECT REUSABLE_RANDOM_NUMBERS.GET_NUMBER
    FROM DUAL;
    Error starting at line 44 in command:
    SELECT REUSABLE_RANDOM_NUMBERS.GET_NUMBER
    FROM DUAL
    Error report:
    SQL Error: ORA-20991: All possible values have ben used, cannot assign a new one
    ORA-06512: przy "TEST.REUSABLE_RANDOM_NUMBERS", linia 26

  • How to create a Random Timeline with checks?

    I have a simple multiple question quiz with 100 questions.
    I want the questions to be randomly asked, without repea
    ting a questions as the end works on a scoring system out of the 100 so it needs to ask
    all the questions.
    Question one starts on frame 5 of the timeline and the last question is on frame 105.
    Can someone please assist on how to write this script with the checks?

    I do apologise, it was not my intent. I thought that if you s
    aw the file you would understand the problem. I love trying to sort
    things out myself and am on the brink of a breakthrough however??
    The problem is and I will explain with the short version I am trying out first.
    Frame 1 is the welcome screen and has a start button to start the quiz.
    Frame 2 the quiz starts and is a multiple answer quiz with 3 answer option only one being correct with the score++ I have on the actions tab the script you sent me of:
    // begin code
    // the for-loop populates frameA with numbers 5,6,...,105
    var frameA:Array = [];
    for(var i:Number=5;i<=105;i++){
    frameA.push(i);
    // the shuffle() function randomizes the contents of frameA
    shuffle(frameA);
    function shuffle(a:Array):Array {
        var len:Number = a.length-1;
        for (var ivar:Number = len; ivar>=0; ivar--) {
            var p:Number = Math.floor(Math.random()*(ivar+1));
            var t = a[ivar];
            a[ivar] = a[p];
            a[p] = t;
        return a;
    // end code
    Each answer is a button and has the gotoAndStop(frameA[0]); script on them:
    The next frame is the next question and has the 3 buttons as well with the following script: gotoAndStop(frameA[1]);
    and then so on till frame 6 with the following script on the 3 buttons: gotoAndStop(frameA[5]);
    It does randomize the questions but seems to repeat questions and does not end up in frame 7 when all questions completed, I assumed with the check it would automatically go to the next frame but am now thinking I need a script to tell it that on completion it needs to go to frame 7.
    Frame 7 basically does the math of the score++ and gives a total.
    I do hope you can assit and once again do apologies.
    Thanks.

  • How can I create a sample with the Flex data?

    Hi mates, I'm thinking about doing some stutter vocals with the ultrabeat so I've got a vocal and I have flexed it in time so it fits well on the song's tempo, the problem is that when I create an audio file of the part of the vocal I want to use on my ultrabeat, it creates an audio file that's not fitted in time.
    How can I create the audio file fitted in time?with the flex info?
    Thanks so much!

    psikonetik wrote:
    How can I create the audio file fitted in time?with the flex info?
    You need to create Apple Loop, REX etc.
    For example select the region that you have already flexed, right click ->Bounce Merge->Bounce Inplace. I will create a new audio track with the bounced Flex work.
    Select the new region and go to Audio menu ->Open in Apple Loop Utility and check "Loop" and other attributes to create an Apple Loop. Save the Apple Loop and close the utility. It's expected that the Apple Loop aif must be created in your Project path folder or have a look at the Audio Bin in Logic where is the aif path.
    Drug the Apple Loop in the Arrange audio track ( or it will create one ) and operate with any tempos.
    !http://img59.imageshack.us/img59/4967/aglogo45.gif!

  • How to generate a random number with at least 6 digits?

    Hi all,
    All is in the question. :-)
    I would like to generate a random number but the function "random
    number" in Labview isn't accurate enough.
    Do you know an algorithm to generate a random number of 6 or more
    digit?
    Thanks,
    PF

    Hi PF,
    It's simple. Use 2 random number functions in the same process. Now you
    should have 2 distinct random numbers that have the same accuracy. Let's say
    LV gives accuracy up to the thousandth (0.XXX), now if you divide one number
    by 1000 and then add to the other number you should then have something like
    0.XXXXXX. Actually, LV random number function can give up to about 17 digits
    (decimal). If you are looking for more digits (>17 digits), the idea above
    may not work, then the last thing you may want try is to generate two or
    three random numbers then convert all these decimal numbers to fractional
    strings chop off the 0 and dot then concatinate them together. After all
    it's still a random number. How many digits do you want to get? Make sure
    the indicators acce
    pt that many digits?
    Good luck
    Louis.
    P-F wrote in message
    news:[email protected]..
    > Hi all,
    >
    > All is in the question. :-)
    >
    > I would like to generate a random number but the function "random
    > number" in Labview isn't accurate enough.
    >
    > Do you know an algorithm to generate a random number of 6 or more
    > digit?
    >
    > Thanks,
    >
    > PF

  • How do you generate random data info using json and spry?

    I have a mobile applicaton that uses spry datasets that dynamically populate a jquery mobile listview by using a json file. Everything is operating as it should.
    However, I would like to understand how to pull random objects from the json file to have them displayed on a different page.
    My json file is standard and not complicated. It has several levels. Each is represented as below:
                                  { "Level1":
                                                                {"imageurl":"images/_myimage.png",
                                                                "someData":"S,A,P,R",
                                                                "levelLongDesc":"further description",
                                                                "name": "John Doe",
                                                                "page": "referencepage",
                                                                "description":"The description of the image"
    {"imageurl":"images/_myimage.png",
      "someData":"S,A,P,R",
      "levelLongDesc":"further description",
      "name": "John Doe",
      "page": "referencepage",
      "description":"The description of the image"
    Json file Level1 has about 70 objects
    What I would like to do is randomly load one of the Level1 object arrays into the page when the user selects a Level 1 radio button that is on the screen. I know how to create the page, radio buttons and basics, but just don't know how to pull in the random data.
    I've found one code sample on this site that speaks to spry and xml, but I haven't been able to apply it in any way that works for me with the json file:
    http://forums.adobe.com/message/662551
    I've also googled. There isn't much on spry datasets with json and generating random info. There was a little bit on sorting, but that didn't help either.
    Does anyone have a good example/tutorial of how to use the random function with spry/json?
    TIA
    -Rachel

    I've done similar things before.  A few thoughts for you:
    1. I'm assuming you're doing a buffered period or frequency measurement on the incoming encoder pulses, right?  First key point is that you'll have data that is spaced equally in position, but not equally in time.  If you are looking for a time-based FFT such that increasing speed will shift your spectrum, you're going to need to go through an interpolation process to resample your data as though equally-spaced in in time. 
    2. Your 149 pulse per rev encoder may be a significant source of error unless its 149 pulses are placed with extreme accuracy.  Any error in pulse placement violates your underlying assumption of data that is equally-spaced in position.  It'll be very helpful to send your data through a software lowpass filter to attenuate those artifacts. 
    3. I am not sure what you mean by "decompose the buffered data (array) into a single datastream."  You'll get an array of periods / frequencies from the call to DAQmx Read.  If you want to use it in a LabVIEW waveform datatype, you'll first need to do the resampling to create equally-spaced-in-time data.  The LabVIEW waveform datatype (and all the analysis functions like FFT that use it) depend on receiving data with a fixed constant time interval between samples.
    -Kevin P.

  • Fitting poisson distribution

    how do i fit a histogram to Poisson distribution ?
    My problem is in incorporating with the factorial in denominator. How do I do that ? I could not even try the gamma function in the formula node (gamma(x+1) = x!). Can anyone please help me in this. I am using Labview 7.1.
    I read another post saying that it is not possible in labview 7.1 ! is it true ? 
    Thanks
    gvs 

    see here

  • How to generate random numbers with a known distribution of f(X)=(8X^2 + 1)*Exp( -X^2 )

    Dear All,
    I need to simulate a random number generator which can generate numbers X with the probability distribution of 
     f (X) = ( 8X^2 + 1)*Exp ( -X^2 ).
    This distribution is not a common distribution.
    I have searched a lot, but I still do not know how to realize it.
    Any help on this topic would be highly appreciated.

    Make a lookup table of the integral of your function (normalized to 1)
    Use the rectangle random generator and pipe that value through the lookup table, scale it ... voila.
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • How to generate random numbers with a known distributi​on f(X)=(8X^2 + 1)*Exp( -X^2 ).

    I need to simulate a random number generator which can generate numbers X with the probability distribution of 
     f (X) = ( 8X^2 + 1)*Exp ( -X^2 ).
    This distribution is not a common distribution.
    I have searched a lot, but I still do not know how to realize it.
    Thanks a lot!
    Solved!
    Go to Solution.

    Don't forget to index back into the original X array for correctly scaled data. Here's a simple example (LV 8.0):
    Seems to work just fine.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    DistributionSimulation.png ‏25 KB
    DistributionSim4.vi ‏44 KB

  • How do I cerate an array with a set of numbers lets say 1 through 12 random order but no repeating.

    How do I cerate  an
    array with a set of numbers lets say 1 through 12 random order but no
    repeating.
    I know this should be easy but my brain wont work
    right now
    Solved!
    Go to Solution.

    OK, here's the handmade version.
    It is useful to know that arrays of clusters are sorted by the cluster order of the elements. Simply bundle random numbers with numbers 1-12 in a loop, create an array at the output tunnel, sort the array by the random number, and extract the number array. It will be shuffled.
    Message Edited by altenbach on 06-04-2007 09:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    shuffleArray.png ‏5 KB

  • How to simulate the underwater and fire effect with Java3D

    Hi...My project is a Java 3D game and it need to have underwater and fire effect, but I dont know how to simulate them with Java3D best..Can anyone give me some ways to make them..thank..

    You'll have to describe what effect you are looking for. Are you trying to model the surface of the water or do you want your scene to appear to be under the water? A surface can be done similar to a terrain but with transparency added to the geometry. Underwater effects would be tough if you want to distort the view of the scene. You might be able to get away with changing the field of view to be wider or rendering each frame yourself.
    For fire effects, are you looking for animated flames? If so there are a few options.
    1. Find a series of images of a fire and apply them to an OrientedShape3D through animation. This would be easiest.
    2. Build a particle system with fuzzy objects (procedural texturing). This would be much harder but more realistic.
    Mike

  • How to generate random objects with a click?

    Hi Guys,
    I am new to the forum so hello to you all!
    I start here with a question that doesn't leave me sleeping during the night.
    I am working on a interactive slideshow.
    That's all right, ultil now.
    Now things becomes blurry for me.
    In every page I would like to add a little animal in the lower right angle of the screen so, when u click on this animal, a baloon appears with a wroten sentence inside it.
    But, I wanto to make the sentences inside the baloon RANDOMLY different every time u click on the animal (using a selection, for example, of 30 sentences at all), but I don't really know what I have to do in order to realize my idea.
    I am not interested to create a preset cycle of sentences, but a random behavior with a click.
    any suggestion please?
    Thaks a lot and best regards!
    Theus

    As I imagined,
    I got some problems to do do that because I am new to the director use. So I can't made it working, if u cant be a little patient with me please, that's will be good!
    What I need is a more "steb by step" help if is not boring for you.
    I go to insert>control>field in order to create a field and then, after double ciking the field, I type four example sentences into the text editor that apperars, right?
    How I have to write the sentences inside the text editor in order to subdivide the text into first sentence, second sentences and so on? There is a special syntax to follow?
    I wrote these exaple sentences:
    "Triangle" "Square" "Circle" "Cube"..... As u see, I am not sure where and how I have to put the sentences in order to select them randomy
    About handlers.
    What I have to do to create an event handler?
    I created a button then i rename it ChooseRandomSentence but now I don't know what I need to do to proceed.
    Here have I to write this script?
    On ChooseRandomSentence
      global gSentenceList, gPreviousNR
      x = gSentenceList.count -- X = count sentences
      y =  random(x) -- Picks a random number from X
      repeat While y  =  gPreviousNR then -- check if number is used previous time player clicked button
          y =  random(x)
       end repeat
      put gSentenceList[y] into field "ShowSentence"  -- Shows random sentence in a field
      put y into gPreviousNR -- add number to next check
    end
    and this?
    on MouseUP
    ChooseRandomSentence
    end
    Some other questions:
    -What about letters X and Y into the exaples scripts u wrote? If I have 4 sentences, which numbers I need to use to replace X and Y?
    -I need to change sentences with  mouse clicking, and not simply moving the mouse over the sprite or the button, is MouseUP command a script about clicking or about moving over?
    As u see I am a very very beginner but I really want to learn, so hope I don't boring u with all those questions.
    Thanks again a lot
    and, If u came in Italy, there is a beer for you! cheers!!!
    Theus

  • My computer, running on Lion, randomly flashes with crazy lights and colors. Doesn't happen often, but when it does it's totally random. What causes this problem and how can I solve it?

    My MacBook Pro, running on Lion, randomly flashes with crazy lights and colors. Doesn't happen often, but when it does it's totally random. It looks like the Northern LIghts!!!
    What causes this problem and how can I solve it?

    Really? Oh I get it. You're the kind of person who goes on tech message boards to make jokes - or friends.
    Well, I'm trying to solve this problem - which is a rather annoying way to spend a Saturday.
    SO either help or don't reply.

Maybe you are looking for

  • Enter G/L account error while uploading open contracts using lsmw

    Hi Experts, I have a flat file for Open Contracts.While trying to upload using LSMW -BAPI method(BUS2014), it is throwing error as 'Enter G/L account' though G/L is present in the flat file.I have done with the mapping in the 5th step. Checked all th

  • Preparing Report on Work Order

    I am preparing a report on Work Order used in EAM. I used EAM_WORK_ORDERS_V to get the details of work orders. But it shows some fields like WIP_ENTITY_ID, WIP_ENTITY_NAME. Does these field mean Work Order Id? I was actually trying to find Work Order

  • Type Group

    what is Type Group? explain it?

  • How to add stop button in this code AS3

    Hello, im new to this adobe flash AS3. i want to create a simple play sound using flash + XML file for wbesite., this is my code all this code are working greate.. but i have the problem to add stop_btn code my playlist button already have pause, pre

  • Unable to install BOXI R3.1 with Oracle 9.2 version

    Hello Iam trying to install BOXI R3.1 on window server 2003 SP2 database as oracale 9.2. i changed the lang_nls_semantics=BYTE and unicode but iam not getting the server intelligence agent(SIA) in Central configuration manager(CCM). if any solution,