numpy.random.RandomState.beta

方法

random.RandomState.beta(a, b, size=None)

从β分布中提取样本。

β分布是狄里克莱分布的一个特例,与伽马分布有关。它具有概率分布函数

System Message: WARNING/2 (f(x;a,b)=\frac{1}{b(\alpha,\beta)}x^{\alpha-1})

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2018-12-01> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ; (U+FF1B) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ; (U+FF1B) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...�\alpha,\beta)}x^{\alpha-1}\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 480 bytes). Transcript written on math.log.

其中标准化B是beta函数,

System Message: WARNING/2 (B(\alpha,\beta)=\int\u 0^1 t^{\alpha-1})

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2018-12-01> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} LaTeX Warning: Command \u invalid in math mode on input line 14. ! Please use \mathaccent for accents in math mode. \add@accent ...@spacefactor \spacefactor }\accent #1 #2\egroup \spacefactor ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! You can't use `\spacefactor' in math mode. \add@accent ...}\accent #1 #2\egroup \spacefactor \accent@spacefactor l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} LaTeX Warning: Command \u invalid in math mode on input line 14. ! Please use \mathaccent for accents in math mode. \add@accent ...@spacefactor \spacefactor }\accent #1 #2\egroup \spacefactor ... l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} ! You can't use `\spacefactor' in math mode. \add@accent ...}\accent #1 #2\egroup \spacefactor \accent@spacefactor l.14 ...beta)=\int\u 0^1 t^{\alpha-1}\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 528 bytes). Transcript written on math.log.

它经常出现在贝叶斯推理和阶统计量中。

注解

新代码应该使用 beta A方法 default_rng() 请参阅 快速启动 .

参数
a浮点数或类似浮点数的数组

α,阳性(>0)。

b浮点数或类似浮点数的数组

β,阳性(>0)。

sizeint或int的元组,可选

输出形状。如果给定的形状是,例如, (m, n, k) 然后 m * n * k 取样。如果尺寸是 None (默认),如果 ab 都是标量。否则, np.broadcast(a, b).size 取样。

返回
outndarray或scalar

从参数化beta分布中提取样本。

参见

Generator.beta

应该用于新代码。