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 9008153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:52:28+00:00 2026-06-16T01:52:28+00:00

I have a lognorm distribution from scipy and its parameters are known. import scipy

  • 0

I have a lognorm distribution from scipy and its parameters are known.

import scipy

log_norm_obj = scipy.stats.lognorm([log_mu], shape=sigma)

I need to solve for a x which satisfies the following equation:

x = (1 - log_norm_obj.cdf(x)) / log_norm_obj.pdf(x)

How could I do this using numpy/scipy? Thanks!

  • 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-06-16T01:52:28+00:00Added an answer on June 16, 2026 at 1:52 am

    You use scipy.optimize. From scipy 0.11 and later, you can use the new functions minimize or minimize_scalar. Assuming your x is a scalar, here’s some example code on how to do it:

    from scipy.optimize import minimize_scalar
    
    def f(x):
        return (1 - log_norm_obj.cdf(x)) / log_norm_obj.pdf(x) - x
    
    result = minimize_scalar(f)        
    print result.x 
    # this would print your result
    

    The above uses Brent’s method, the default. You can also the Golden method, or a bounded version of Brent’s method. The latter could be useful if your function is only defined in a given domain or you want a solution in a specific interval. An example of this:

    result = minimize_scalar(f, bounds=(0, 10.), method='bounded')
    

    If your function takes a vector instead of a scalar, a similar approach can be taken using minimize. If your scipy is older than version 0.11, just use a flavour of fmin.

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

Sidebar

Related Questions

I have been trying to get the result of a lognormal distribution using Scipy
have a nice day. I got problem when trying to create an image from
Have a photography site that I want to prevent image copying from. How can
Have a script to add / remove options from a select field -- the
Have a linking (or ref) table which has a dual primary key. Need to
have this code import threading def Thread(f): def decorator(*args,**kargs): print(args) thread = threading.Thread(target=f, args=args)
I'm trying to fit some data to a lognormal distribution and from this generate
Have a TSQL view, which I need to group by one column, however, am
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=

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.