📄 mf_normal.hlp
字号:
{smcl}
{* 07apr2005}{...}
{cmd:help mata normal()}
{hline}
{* index statistical density functions}{...}
{* index statistical distribution functions}{...}
{* index density functions}{...}
{* index distribution functions}{...}
{* index normalden()}{...}
{* index normal()}{...}
{* index invnormal()}{...}
{* index binormal()}{...}
{* index chi2()}{...}
{* index chi2tail()}{...}
{* index invchi2()}{...}
{* index invchi2tail()}{...}
{* index tden()}{...}
{* index ttail()}{...}
{* index invttail()}{...}
{* index Fden()}{...}
{* index F()}{...}
{* index Ftail()}{...}
{* index invF()}{...}
{* index invFtail()}{...}
{* index nFden()}{...}
{* index nFtail()}{...}
{* index invnFtail()}{...}
{* index Binomial()}{...}
{* index invbinomial()}{...}
{* index betaden()}{...}
{* index ibeta()}{...}
{* index invibeta()}{...}
{* index nbetaden()}{...}
{* index nibeta()}{...}
{* index invnibeta()}{...}
{* index gammaden()}{...}
{* index gammap()}{...}
{* index invgammap()}{...}
{* index dgammapda()}{...}
{* index dgammapdx()}{...}
{* index dgammapdada()}{...}
{* index dgammapdadx()}{...}
{* index dgammapdxdx()}{...}
{* index r-conformability}{...}
{title:Title}
{p 4 8 2}
{bf:[M-5] normal() -- Cumulatives, reverse cumulatives, and densities}
{title:Syntax}
Gaussian normal:
{it:f} = {cmd:normalden(}{it:z}{cmd:)}
{it:f} = {cmd:normalden(}{it:x}{cmd:,} {it:sd}{cmd:)}
{it:f} = {cmd:normalden(}{it:x}{cmd:,} {it:mean}, {it:sd}{cmd:)}
{it:p} = {cmd:normal(}{it:z}{cmd:)}
{it:z} = {cmd:invnormal(}{it:p}{cmd:)}
Binormal:
{it:p} = {cmd:binormal(}{it:z1}{cmd:,} {it:z2}{cmd:,} {it:rho}{cmd:)}
Chi-squared:
{it:p} = {cmd:chi2(}{it:n}{cmd:,} {it:x}{cmd:)}
{it:q} = {cmd:chi2tail(}{it:n}{cmd:,} {it:x}{cmd:)}
{it:x} = {cmd:invchi2(}{it:n}{cmd:,} {it:p}{cmd:)}
{it:x} = {cmd:invchi2tail(}{it:n}{cmd:,} {it:q}{cmd:)}
Noncentral chi-squared:
{it:p} = {cmd:nchi2(}{it:n}{cmd:,} {it:L}{cmd:,} {it:x}{cmd:)}
{it:x} = {cmd:invnchi2(}{it:n}{cmd:,} {it:L}{cmd:,} {it:p}{cmd:)}
{it:L} = {cmd:npnchi2(}{it:n}{cmd:,} {it:x}{cmd:,} {it:p}{cmd:)}
Student's t:
{it:f} = {cmd:tden(}{it:n}{cmd:,} {it:t}{cmd:)}
{it:q} = {cmd:ttail(}{it:n}{cmd:,} {it:t}{cmd:)}
{it:t} = {cmd:invttail(}{it:n}{cmd:,} {it:q}{cmd:)}
F:
{it:f} = {cmd:Fden(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:Fstat}{cmd:)}
{it:p} = {cmd:F(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:Fstat}{cmd:)}
{it:q} = {cmd:Ftail(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:Fstat}{cmd:)}
{it:Fstat} = {cmd:invF(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:p}{cmd:)}
{it:Fstat} = {cmd:invFtail(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:q}{cmd:)}
Noncentral F:
{it:f} = {cmd:nFden(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:L}{cmd:,} {it:F}{cmd:)}
{it:q} = {cmd:nFtail(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:L}{cmd:,} {it:F}{cmd:)}
{it:F} = {cmd:invnFtail(}{it:n1}{cmd:,} {it:n2}{cmd:,} {it:L}{cmd:,} {it:q}{cmd:)}
Binomial:
{it:q} = {cmd:Binomial(}{it:n}{cmd:,} {it:k}{cmd:,} {it:pi}{cmd:)}
{it:pi} = {cmd:invbinomial(}{it:n}{cmd:,} {it:k}{cmd:,} {it:p}{cmd:)}
Beta:
{it:f} = {cmd:betaden(}{it:a}{cmd:,} {it:b}{cmd:,} {it:x}{cmd:)}
{it:p} = {cmd:ibeta(}{it:a}{cmd:,} {it:b}{cmd:,} {it:x}{cmd:)}
{it:x} = {cmd:invibeta(}{it:a}{cmd:,} {it:b}{cmd:,} {it:p}{cmd:)}
Noncentral Beta:
{it:f} = {cmd:nbetaden(}{it:a}{cmd:,} {it:b}{cmd:,} {it:L}{cmd:,} {it:x}{cmd:)}
{it:p} = {cmd:nibeta(}{it:a}{cmd:,} {it:b}{cmd:,} {it:L}{cmd:,} {it:x}{cmd:)}
{it:x} = {cmd:invnibeta(}{it:a}{cmd:,} {it:b}{cmd:,} {it:L}{cmd:,} {it:p}{cmd:)}
Gamma:
{it:f} = {cmd:gammaden(}{it:a}{cmd:,} {it:b}{cmd:,} {it:g}{cmd:,} {it:x}{cmd:)}
{it:p} = {cmd:gammap(}{it:a}{cmd:,} {it:x}{cmd:)}
{it:x} = {cmd:invgammap(}{it:a}{cmd:,} {it:p}{cmd:)}
{it:dg/da} = {cmd:dgammapda(}{it:a}{cmd:,} {it:x}{cmd:)}
{it:dg/dx} = {cmd:dgammapdx(}{it:a}{cmd:,} {it:x}{cmd:)}
{it:d2g/da2} = {cmd:dgammapdada(}{it:a}{cmd:,} {it:x}{cmd:)}
{it:d2g/dadx} = {cmd:dgammapdadx(}{it:a}{cmd:,} {it:x}{cmd:)}
{it:d2g/dx2} = {cmd:dgammapdxdx(}{it:a}{cmd:,} {it:x}{cmd:)}
{p 4 8 2}
where
{p 8 12 2}
1. All functions return real and all arguments are real.
{p 8 12 2}
2. The left-hand-side notation is used to assist in interpreting the
meaning of the returned value:
{it:f} = density value
{it:p} = left cumulative = Pr(-infinity < {it:statistic} <= {it:x})
{it:q} = right cumulative = 1 - {it:p}
{title:Description}
{p 4 4 2}
The above functions return density values, cumulatives, reverse
cumulatives, and in one case, derivatives, of the indicated
probability density function.
These functions mirror the Stata functions of the same
name and in fact are the Stata functions.
{p 4 4 2}
See {bf:{help probfun:[D] functions}}
for function details.
In the syntax diagram above, some arguments have been renamed in
hopes of aiding understanding, but the function arguments match
one-to-one with the underlying Stata functions.
{title:Remarks}
{p 4 4 2}
Remarks are presented under the headings
{bf:R-conformability}
{bf:A note concerning Binomial() and invbinomial()}
{bf:A note concerning ibeta()}
{bf:A note concerning gammap()}
{title:R-conformability}
{p 4 4 2}
The above functions are usually used with scalar arguments and, in that case,
return a scalar result:
: {cmd:x = chi2(10, 12)}
: {cmd:x}
{res:.7149434997}
{p 4 4 2}
The arguments may, however, be vectors or matrices. For instance,
: {cmd:x = chi2((10,11,12), 12)}
: {cmd:x}
{res} {txt} 1 2 3
{c TLC}{hline 43}{c TRC}
1 {c |} {res}.7149434997 .6363567795 .5543203586{txt} {c |}
{c BLC}{hline 43}{c BRC}{txt}
: {cmd:x = chi2(10, (12,12.5,13))}
: {cmd:x}
{res} {txt} 1 2 3
{c TLC}{hline 43}{c TRC}
1 {c |} {res}.7149434997 .7470146767 .7763281832{txt} {c |}
{c BLC}{hline 43}{c BRC}{txt}
: {cmd:x = chi2((10,11,12), (12,12.5,13))}
: {cmd:x}
{res} {txt} 1 2 3
{c TLC}{hline 43}{c TRC}
1 {c |} {res}.7149434997 .6727441644 .6309593164{txt} {c |}
{c BLC}{hline 43}{c BRC}{txt}
{p 4 4 2}
In the last example, the numbers correspond to {cmd:chi2(10,12)},
{cmd:chi2(11,12.5)}, and {cmd:chi2(12,13)}.
{p 4 4 2}
Arguments are required to be r-conformable (see help
{bf:{help m6_glossary:[M-6] glossary}}),
and thus,
: {cmd:x = chi2((10\11\12), (12,12.5,13))}
: {cmd:x}
{res} {txt} 1 2 3
{c TLC}{hline 43}{c TRC}
1 {c |} {res}.7149434997 .7470146767 .7763281832{txt} {c |}
2 {c |} {res}.6363567795 .6727441644 .7066745906{txt} {c |}
3 {c |} {res}.5543203586 .593595966 .6309593164{txt} {c |}
{c BLC}{hline 43}{c BRC}{txt}
{p 4 4 2}
which corresponds to
{res} {txt} 1 2 3
{c TLC}{hline 43}{c TRC}
1 {c |} {cmd}chi2(10,12) chi2(10,12.5) chi2(10,13){txt} {c |}
2 {c |} {cmd}chi2(11,12) chi2(11,12.5) chi2(11,13){txt} {c |}
3 {c |} {cmd}chi2(12,12) chi2(12,12.5) chi2(12,13){txt} {c |}
{c BLC}{hline 43}{c BRC}{txt}
{title:A note concerning Binomial() and invbinomial()}
{p 4 4 2}
{cmd:Binomial()} and {cmd:invbinomial()} do not follow the naming
conventions:
{p 4 4 2}
{cmd:Binomial(}{it:n}{cmd:,} {it:k}{cmd:,} {it:pi}{cmd:)} returns the right
cumulative, the probability of {it:k} or more successes in {it:n} trials
when the probability of a success is {it:pi}.
{p 4 4 2}
{cmd:invbinomial(}{it:n}{cmd:,} {it:k}{cmd:,} {it:p}{cmd:)} is useful for
calculating confidence intervals for {it:pi}, the probability of success. For
{it:p}<.5, {cmd:invbinomial()} returns the probability {it:pi} such that the
probability of observing {it:k} or more successes in {it:n} trials is {it:p}.
For {it:p}>.5, {cmd:invbinomial()} returns the probability {it:pi} such that
the probability of observing {it:k} or fewer successes in {it:n} trials is
1-{it:p}.
{title:A note concerning ibeta()}
{p 4 4 2}
{cmd:ibeta(}{it:a}{cmd:,} {it:b}{cmd:,} {it:x}{cmd:)}
is known as the cumulative beta distribution, and it is known as the
incomplete beta function {it:I_x}({it:a}, {it:b}).
{title:A note concerning gammap()}
{p 4 4 2}
{cmd:gammap(}{it:a}{cmd:,} {it:x}{cmd:)}
is known as the cumulative gamma distribution, and it is known
as the incomplete gamma function {it:P}({it:a}, {it:x}).
{title:Conformability}
{p 4 4 2}
All functions require arguments be r-conformable; see {bf:R-conformability}
above. Returned is matrix of max(argument rows) rows and max(argument
columns) columns containing element-by-element calculated results.
{title:Source code}
{p 4 4 2}
Functions are built-in.
{title:Diagnostics}
{p 4 4 2}
All functions return missing when arguments are out of range.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] normal()}
{p 4 13 2}
Online: help for
{bf:{help m4_statistical:[M-4] statistical}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -