Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 352325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:43:36+00:00 2026-05-12T11:43:36+00:00

Is there a package in Perl that allows you to compute the height of

  • 0

Is there a package in Perl that allows you to compute the height of probability distribution at each given point. For example this can be done in R this way:

> dnorm(0, mean=4,sd=10)
> 0.03682701

Namely the probability of point x=0 falls into a normal distribution, with mean=4 and sd=10, is 0.0368.
I looked at Statistics::Distribution but it doesn’t give that very
function to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:43:36+00:00Added an answer on May 12, 2026 at 11:43 am

    Why not something along these lines (I am writing in R, but it could be done in perl with Statistics::Distribution):

    dn <- function(x=0 # value
                   ,mean=0 # mean 
                   ,sd=1 # sd
                   ,sc=10000 ## scale the precision
                   ) {
      res <- (pnorm(x+1/sc, mean=mean, sd=sd)-pnorm(x, mean=mean, sd=sd))*sc
      res
    }
    > dn(0,4,10,10000)
    0.03682709
    > dn(2.02,2,.24)
    1.656498
    

    [edit:1] I should mention that this approximation can get pretty horrible at the far tails. it might or might not matter depending on your application.

    [edit:2] @foolishbrat Turned the code into a function. The result should always be positive. Perhaps you are forgetting that in the perl module you mention the function returns the upper probability 1-F, and R returns F?

    [edit: 3] fixed a copy and paste error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there's an idiomatic one-liner or a standard-distribution package/function that I can
Let's say there are two modules that mutually use each other: package a; use
So I have a file that in short has this problem... #!/usr/bin/perl -w package
Is there a package/library for python that would allow me to open a PDF,
There is a note at the end of the atomics package summary that states:
This question is related to the last point of Item 46 in Effective Perl
How do you completely delete a package in Perl? This means not only the
I've got an XML::SAX::Base-based parser that looks something like this: package MyParser; use base
When you run perl -e "Bla->new" , you get this well-known error: Can't locate
Is there a package that helps me benchmark JavaScript code? I'm not referring to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.