File:Echantillonnage-preferentiel.svg

Original file(SVG file, nominally 720 × 540 pixels, file size: 36 KB)

Captions

Captions

Add a one-line explanation of what this file represents
Description
English: A triangular distribution on [0,1]
Date
Source Own work
Author David Kremer
Permission
(Reusing this file)
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 3.0 Unported license.
Attribution: David Kremer
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

>>> from scipy import special
>>> special.beta(
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid number of arguments
>>> special.beta(5,3)
0.0095238095238095247
>>> 1/105.
0.009523809523809525
>>> special.betainc(5,3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid number of arguments
>>> special.betainc(5,3,0.5)
0.22656249999999992
>>> from pylab import *
>>> x = arange(0,1,1e-4)
>>> y = special.betainc(5,3,x)
>>> plot(x,y)
[<matplotlib.lines.Line2D object at 0x99e79ac>]
>>> title("Gamma distribution of parameters 5,3")
<matplotlib.text.Text object at 0x9869fac>                                                                                                                                          
>>> xlabel ("x")                                                                                                                                                                    
<matplotlib.text.Text object at 0x9856ccc>                                                                                                                                          
>>> ylabel("$\int_{0}^{x}x^{4}(1-x)^2 dx$")
<matplotlib.text.Text object at 0x985db0c>                                                                                                                                          
>>> show()                                                                                                                                                                          
>>> y2 = [][:6666] &#x5D;                                                                                                                                                  
>>> y2.join( [][6666:] &#x5D; )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'join'
>>> y2.append( [][6666:] &#x5D; )
>>> plot(x,y2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2287, in plot
    ret = ax.plot(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 3771, in plot
    for line in self._get_lines(*args, **kwargs):
  File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 317, in _grab_next_args
    for seg in self._plot_args(remaining, kwargs):
  File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 287, in _plot_args
    y = np.atleast_1d(tup[-1])
  File "/usr/lib/python2.7/site-packages/numpy/core/shape_base.py", line 47, in atleast_1d
    res.append(array(ary,copy=False,subok=True,ndmin=1))
ValueError: setting an array element with a sequence.
>>> len(y2)
6667
>>> help(y2)

>>> y2.remove(-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> del y2[-1]
>>> len(y2)
6666
>>> y2.extend( [][6666:] &#x5D; )
>>> len(y2)
10000
>>> len(x)
10000
>>> plot(x,y2)
[<matplotlib.lines.Line2D object at 0x9eca24c>]
>>> title('$x$')
<matplotlib.text.Text object at 0x9cc5aac>
>>> title('Echantillonnage preferentiel')
<matplotlib.text.Text object at 0x9cc5aac>
>>> xlabel("$x$")
<matplotlib.text.Text object at 0x944578c>
>>> ylabel("$f^{*}(x)$")
<matplotlib.text.Text object at 0x9cbcacc>
>>> show()
>>> y3 = [ r**4 * (1-r)**2 for r in x ]
>>> plot(x,y3);title("Integrand $x^4(1-x)^2$");xlabel("x");ylabel("$y=x^4(1-x)^2$")
[<matplotlib.lines.Line2D object at 0x986972c>]
<matplotlib.text.Text object at 0x99dd50c>
<matplotlib.text.Text object at 0x9ec8d4c>
<matplotlib.text.Text object at 0x9cc528c>
>>> show()

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current08:42, 6 November 2010Thumbnail for version as of 08:42, 6 November 2010720 × 540 (36 KB)Okiokiyuki (talk | contribs){{Information |Description={{en|1=A triangular distribution on [0,1]}} |Source=>>> from scipy import special >>> special.beta( ... ) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid number of arguments >>> speci

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: