From andyfaff at gmail.com Tue Feb 6 18:01:30 2018 From: andyfaff at gmail.com (Andrew Nelson) Date: Wed, 7 Feb 2018 10:01:30 +1100 Subject: [SciPy-User] stats.norm and integrate.quad Message-ID: Hi all, I'm trying to integrate stats.norm.pdf in the range [-np.inf, x] using integrate.quad. I'm having a few issues where the integral dives to zero when it should be one - https://gist.github.com/andyfaff/c8a94ab87333c42791e58e7d6e12a05e It does this when norm.pdf(x) reaches the smallest number expressible by a float, and for some unknown reason when x ~ 20. Is there anyway I can mitigate against this behaviour using `integrate.quad` options? I'm hoping this is expected behaviour. cheers, Andrew. p.s. I'm using integration instead of norm.cdf for a specific reason. -- _____________________________________ Dr. Andrew Nelson _____________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From josef.pktd at gmail.com Tue Feb 6 18:42:11 2018 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Tue, 6 Feb 2018 18:42:11 -0500 Subject: [SciPy-User] stats.norm and integrate.quad In-Reply-To: References: Message-ID: On Tue, Feb 6, 2018 at 6:01 PM, Andrew Nelson wrote: > Hi all, > I'm trying to integrate stats.norm.pdf in the range [-np.inf, x] using > integrate.quad. I'm having a few issues where the integral dives to zero > when it should be one - https://gist.github.com/andyfaff/ > c8a94ab87333c42791e58e7d6e12a05e > > It does this when norm.pdf(x) reaches the smallest number expressible by a > float, and for some unknown reason when x ~ 20. > > Is there anyway I can mitigate against this behaviour using > `integrate.quad` options? I'm hoping this is expected behaviour. > AFAIR, I never figured out the quad options for this (there are no gaussian weights) Things that I tried in the past: use integration limit using information about where tails are close to zero >>> from scipy import stats >>> stats.norm.ppf(1e-10) -6.3613409024040557 >>> stats.norm.ppf(1e-15) -7.9413453261709979 >>> stats.norm.isf(1e-15) 7.9413453261709979 break up in sub intervals with known central region (I only tried the points option iin quad for a few bad cases, AFAIR) >>> from scipy.integrate import quad >>> quad(stats.norm.pdf, -np.inf, 40) (5.505747798875221e-28, 1.0434548229074602e-27) >>> quad(stats.norm.pdf, -np.inf, 0) (0.4999999999999999, 5.089095674629994e-09) >>> quad(stats.norm.pdf, 0, 40) (0.5000000000000001, 4.335515230512748e-10) use more symmetric bounds so integrate quad looks at where the spike or action is >>> quad(stats.norm.pdf, -40, 40) (1.0000000000000002, 8.671029619552417e-10) use an indicator function and integrate over full range -inf, inf >>> quad(lambda x: stats.norm.pdf(x) * (x <= 40), -np.inf, np.inf) (0.9999999999999998, 1.0178191349259989e-08) >>> quad(lambda x: stats.norm.pdf(x) * (x <= 0), -np.inf, np.inf) (0.4999999999999999, 5.089095674629994e-09) Josef > > cheers, > Andrew. > > > p.s. I'm using integration instead of norm.cdf for a specific reason. > > -- > _____________________________________ > Dr. Andrew Nelson > > > _____________________________________ > > _______________________________________________ > SciPy-User mailing list > SciPy-User at python.org > https://mail.python.org/mailman/listinfo/scipy-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Victor.Poughon at cnes.fr Fri Feb 16 11:16:37 2018 From: Victor.Poughon at cnes.fr (Poughon Victor) Date: Fri, 16 Feb 2018 16:16:37 +0000 Subject: [SciPy-User] Minimize many scalar functions Message-ID: <3E55146A6A81B44A9CB69CAB65908CEA53E44543@TW-MBX-P01.cnesnet.ad.cnes.fr> Hi all, I'd like to minimize hundreds of thousands of scalar valued functions. Is there a faster way than a for-loop over a def of the objective function and a call to scipy.optimize.minimize_scalar? Basically a vectorized version, where I could give a function foo and a 2D numpy array where each row is given as extra data to the objective function. Thanks, Victor Poughon -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume at damcb.com Sat Feb 17 10:04:42 2018 From: guillaume at damcb.com (Guillaume Gay) Date: Sat, 17 Feb 2018 16:04:42 +0100 Subject: [SciPy-User] Minimize many scalar functions In-Reply-To: <3E55146A6A81B44A9CB69CAB65908CEA53E44543@TW-MBX-P01.cnesnet.ad.cnes.fr> References: <3E55146A6A81B44A9CB69CAB65908CEA53E44543@TW-MBX-P01.cnesnet.ad.cnes.fr> Message-ID: <672618f6-a896-03af-1aeb-5a339e9f86f0@damcb.com> Hi Victor, I guess it depends a lot on the scalar functions and if they can be vectorized... But you can always optimize on an array of inputs with optimize.minimize, can't you? A more explicit example would help us help you I guess. Best Guillaume Le 16/02/2018 ? 17:16, Poughon Victor a ?crit?: > > Hi all, > > I'd like to minimize hundreds of thousands of scalar valued functions. > Is there a faster way than a for-loop over a |def|of the objective > function and a call to |scipy.optimize.minimize_scalar|? Basically a > vectorized version, where I could give a function |foo|and a 2D numpy > array where each row is given as extra data to the objective function. > > Thanks, > > Victor Poughon > > > > _______________________________________________ > SciPy-User mailing list > SciPy-User at python.org > https://mail.python.org/mailman/listinfo/scipy-user -- Guillaume Gay, PhD Morphg?nie Logiciels SAS http://morphogenie.fr 12 rue Camoin Jeune 13004 Marseille +336 51 95 94 00 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Victor.Poughon at cnes.fr Tue Feb 20 03:07:37 2018 From: Victor.Poughon at cnes.fr (Poughon Victor) Date: Tue, 20 Feb 2018 08:07:37 +0000 Subject: [SciPy-User] Minimize many scalar functions In-Reply-To: <672618f6-a896-03af-1aeb-5a339e9f86f0@damcb.com> References: <3E55146A6A81B44A9CB69CAB65908CEA53E44543@TW-MBX-P01.cnesnet.ad.cnes.fr> <672618f6-a896-03af-1aeb-5a339e9f86f0@damcb.com> Message-ID: <3E55146A6A81B44A9CB69CAB65908CEA53E44A27@TW-MBX-P01.cnesnet.ad.cnes.fr> Hi Guillaume, Thanks for the answer. It looks my problem is acknowledged on a few github issues and PRs, see here for example: https://github.com/scipy/scipy/pull/8357 However I'm not sure that even this PR would solve my specific usage of many calls to optimize.minimize_scalar with objective functions parametrized slightly differently for each. Victor Poughon De : SciPy-User [mailto:scipy-user-bounces+victor.poughon=cnes.fr at python.org] De la part de Guillaume Gay Envoy? : samedi 17 f?vrier 2018 16:05 ? : scipy-user at python.org Objet : Re: [SciPy-User] Minimize many scalar functions Hi Victor, I guess it depends a lot on the scalar functions and if they can be vectorized... But you can always optimize on an array of inputs with optimize.minimize, can't you? A more explicit example would help us help you I guess. Best Guillaume Le 16/02/2018 ? 17:16, Poughon Victor a ?crit : Hi all, I'd like to minimize hundreds of thousands of scalar valued functions. Is there a faster way than a for-loop over a def of the objective function and a call to scipy.optimize.minimize_scalar? Basically a vectorized version, where I could give a function foo and a 2D numpy array where each row is given as extra data to the objective function. Thanks, Victor Poughon _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user -- Guillaume Gay, PhD Morphg?nie Logiciels SAS http://morphogenie.fr 12 rue Camoin Jeune 13004 Marseille +336 51 95 94 00 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.barker at noaa.gov Tue Feb 20 11:43:26 2018 From: chris.barker at noaa.gov (Chris Barker - NOAA Federal) Date: Tue, 20 Feb 2018 08:43:26 -0800 Subject: [SciPy-User] Minimize many scalar functions In-Reply-To: <3E55146A6A81B44A9CB69CAB65908CEA53E44A27@TW-MBX-P01.cnesnet.ad.cnes.fr> References: <3E55146A6A81B44A9CB69CAB65908CEA53E44543@TW-MBX-P01.cnesnet.ad.cnes.fr> <672618f6-a896-03af-1aeb-5a339e9f86f0@damcb.com> <3E55146A6A81B44A9CB69CAB65908CEA53E44A27@TW-MBX-P01.cnesnet.ad.cnes.fr> Message-ID: However I?m not sure that even this PR would solve my specific usage of many calls to optimize.minimize_scalar with objective functions parametrized slightly differently for each. Function call overhead is notoriously large in Python, but optimizations are usually very expensive as well. Is the function call overhead really the bottleneck here? -CHB Victor Poughon *De :* SciPy-User [ mailto:scipy-user-bounces+victor.poughon=cnes.fr at python.org ] *De la part de* Guillaume Gay *Envoy? :* samedi 17 f?vrier 2018 16:05 *? :* scipy-user at python.org *Objet :* Re: [SciPy-User] Minimize many scalar functions Hi Victor, I guess it depends a lot on the scalar functions and if they can be vectorized... But you can always optimize on an array of inputs with optimize.minimize, can't you? A more explicit example would help us help you I guess. Best Guillaume Le 16/02/2018 ? 17:16, Poughon Victor a ?crit : Hi all, I'd like to minimize hundreds of thousands of scalar valued functions. Is there a faster way than a for-loop over a def of the objective function and a call to scipy.optimize.minimize_scalar? Basically a vectorized version, where I could give a function foo and a 2D numpy array where each row is given as extra data to the objective function. Thanks, Victor Poughon _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user -- Guillaume Gay, PhD Morphg?nie Logiciels SAS http://morphogenie.fr 12 rue Camoin Jeune 13004 Marseille +336 51 95 94 00 _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlesr.harris at gmail.com Tue Feb 20 20:21:32 2018 From: charlesr.harris at gmail.com (Charles R Harris) Date: Tue, 20 Feb 2018 18:21:32 -0700 Subject: [SciPy-User] NumPy 1.14.1 released Message-ID: Hi All, On behalf of the NumPy team, I am pleased to announce NumPy 1.14.1. This is a bugfix release for some problems reported following the 1.14.0 release. The major problems fixed are the following. - Problems with the new array printing, particularly the printing of complex values, Please report any additional problems that may turn up. - Problems with ``np.einsum`` due to the new ``optimized=True`` default. Some fixes for optimization have been applied and ``optimize=False`` is now the default. - The sort order in ``np.unique`` when ``axis=`` will now always be lexicographic in the subarray elements. In previous NumPy versions there was an optimization that could result in sorting the subarrays as unsigned byte strings. - The change in 1.14.0 that multi-field indexing of structured arrays returns a view instead of a copy has been reverted but remains on track for NumPy 1.15. Affected users should read the 1.14.1 Numpy User Guide section "basics/structured arrays/accessing multiple fields" for advice on how to manage this transition. This release supports Python 2.7 and 3.4 - 3.6. Wheels for the release are available on PyPI. Source tarballs, zipfiles, release notes, and the changelog are available on github . *Contributors* A total of 14 people contributed to this release. People with a "+" by their names contributed a patch for the first time. * Allan Haldane * Charles Harris * Daniel Smith * Dennis Weyland + * Eric Larson * Eric Wieser * Jarrod Millman * Kenichi Maehashi + * Marten van Kerkwijk * Mathieu Lamarre * Sebastian Berg * Simon Conseil * Simon Gibbons * xoviat Cheers, Charles Harris -------------- next part -------------- An HTML attachment was scrubbed... URL: From smkjain8 at gmail.com Wed Feb 21 02:20:05 2018 From: smkjain8 at gmail.com (Samyak Jain) Date: Wed, 21 Feb 2018 12:50:05 +0530 Subject: [SciPy-User] Contributing to scipy Message-ID: Hi, I am Samyak Jain and new to open source and very keen in contributing towards open source. I have started contributing in scipy solving some small DOC issues but I want to solve some major issues too. Can you suggest how do I start with this and also what all I need to know apart from python to start contributing in this org. I am also applying for GSOC'18 by contributing with this org hence I need to know how can I contact the mentors as on the IRC no one is replying. Is there any other way to contact them ? -------------- next part -------------- An HTML attachment was scrubbed... URL: