Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • R rnegbin

    Anyone know what is the explicit function that is being plotted when rnegbin is called i.e. what is the exact function for negative binomial?

    For example using these numbers

    Code:
    plot(rnegbin(1000, 45, 5))

  • #2
    Originally posted by TheSeqGeek View Post
    what is the exact function for negative binomial?
    From the help of rnegbin:

    The function uses the representation of the Negative Binomial
    distribution as a continuous mixture of Poisson distributions with
    Gamma distributed means
    and from the code itself:

    Code:
    rpois(k, (mu * rgamma(k, theta))/theta)

    Comment


    • #3
      rnegbin is a function which generates values according to a Negative Binomial distribution. The result of your example generates a vector of 1000 values.
      Please use the R help function for more information.
      Moreover, just typing the function name gives you:
      Code:
      > rnegbin
      function (n, mu = n, theta = stop("'theta' must be specified"))
      {   
          k <- if (length(n) > 1L)
              length(n)
          else n
          rpois(k, (mu * rgamma(k, theta))/theta)
      }
      The plot function is just plot.default with your 1000 values on the y-axis and each values rank in the vector on the x-axis.

      Comment


      • #4
        I guess I was more looking for f(x) = e^(lambda) bla bla bla

        Comment


        • #5
          It'd be the probability mass function, which you can find on wikipedia.

          Comment


          • #6
            Thank you.... I looked on Wikipedia and didn't know which one of those... PMF will do

            Thanks

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Best Practices for Single-Cell Sequencing Analysis
              by seqadmin



              While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
              Yesterday, 07:15 AM
            • seqadmin
              Latest Developments in Precision Medicine
              by seqadmin



              Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

              Somatic Genomics
              “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
              05-24-2024, 01:16 PM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Today, 06:58 AM
            0 responses
            13 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 08:18 AM
            0 responses
            19 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 08:04 AM
            0 responses
            18 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 06-03-2024, 06:55 AM
            0 responses
            13 views
            0 likes
            Last Post seqadmin  
            Working...
            X