다음: , 이전: , 상위 문서: Arithmetic   [차례][찾아보기]


17.6 Special Functions

[a, ierr] = airy (k, z, opt)

Compute Airy functions of the first and second kind, and their derivatives.

 K   Function   Scale factor (if "opt" is supplied)
---  --------   ---------------------------------------
 0   Ai (Z)     exp ((2/3) * Z * sqrt (Z))
 1   dAi(Z)/dZ  exp ((2/3) * Z * sqrt (Z))
 2   Bi (Z)     exp (-abs (real ((2/3) * Z * sqrt (Z))))
 3   dBi(Z)/dZ  exp (-abs (real ((2/3) * Z * sqrt (Z))))

The function call airy (z) is equivalent to airy (0, z).

The result is the same size as z.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Loss of significance by argument reduction, output may be inaccurate.
  6. Error—no computation, algorithm termination condition not met, return NaN.
J = besselj (alpha, 가로)
J = besselj (alpha, 가로, opt)
[J, ierr] = besselj (…)

Compute Bessel functions of the first kind.

The order of the Bessel function alpha must be real. The points for evaluation 가로 may be complex.

If the optional argument opt is 1 or true, the result J is multiplied by exp (-abs (imag (가로))).

If alpha is a scalar, the result is the same size as 가로. If 가로 is a scalar, the result is the same size as alpha. If alpha is a row vector and 가로 is a column vector, the result is a matrix with length (가로) rows and length (alpha) columns. Otherwise, alpha and 가로 must conform and the result will be the same size.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Loss of significance by argument reduction, output may be inaccurate.
  6. Error—no computation, algorithm termination condition not met, return NaN.

같이 보기: bessely, besseli, besselk, besselh.

세로 = bessely (alpha, 가로)
세로 = bessely (alpha, 가로, opt)
[세로, ierr] = bessely (…)

Compute Bessel functions of the second kind.

The order of the Bessel function alpha must be real. The points for evaluation 가로 may be complex.

If the optional argument opt is 1 or true, the result 세로 is multiplied by exp (-abs (imag (가로))).

If alpha is a scalar, the result is the same size as 가로. If 가로 is a scalar, the result is the same size as alpha. If alpha is a row vector and 가로 is a column vector, the result is a matrix with length (가로) rows and length (alpha) columns. Otherwise, alpha and 가로 must conform and the result will be the same size.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Complete loss of significance by argument reduction, return NaN.
  6. Error—no computation, algorithm termination condition not met, return NaN.

같이 보기: besselj, besseli, besselk, besselh.

I = besseli (alpha, 가로)
I = besseli (alpha, 가로, opt)
[I, ierr] = besseli (…)

Compute modified Bessel functions of the first kind.

The order of the Bessel function alpha must be real. The points for evaluation 가로 may be complex.

If the optional argument opt is 1 or true, the result I is multiplied by exp (-abs (real (가로))).

If alpha is a scalar, the result is the same size as 가로. If 가로 is a scalar, the result is the same size as alpha. If alpha is a row vector and 가로 is a column vector, the result is a matrix with length (가로) rows and length (alpha) columns. Otherwise, alpha and 가로 must conform and the result will be the same size.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Complete loss of significance by argument reduction, return NaN.
  6. Error—no computation, algorithm termination condition not met, return NaN.

같이 보기: besselk, besselj, bessely, besselh.

K = besselk (alpha, 가로)
K = besselk (alpha, 가로, opt)
[K, ierr] = besselk (…)

Compute modified Bessel functions of the second kind.

The order of the Bessel function alpha must be real. The points for evaluation 가로 may be complex.

If the optional argument opt is 1 or true, the result K is multiplied by exp (가로).

If alpha is a scalar, the result is the same size as 가로. If 가로 is a scalar, the result is the same size as alpha. If alpha is a row vector and 가로 is a column vector, the result is a matrix with length (가로) rows and length (alpha) columns. Otherwise, alpha and 가로 must conform and the result will be the same size.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Complete loss of significance by argument reduction, return NaN.
  6. Error—no computation, algorithm termination condition not met, return NaN.

같이 보기: besseli, besselj, bessely, besselh.

H = besselh (alpha, 가로)
H = besselh (alpha, k, 가로)
H = besselh (alpha, k, 가로, opt)
[H, ierr] = besselh (…)

Compute Bessel functions of the third kind (Hankel functions).

The order of the Bessel function alpha must be real. The kind of Hankel function is specified by k and may be either first (k = 1) or second (k = 2). The default is Hankel functions of the first kind. The points for evaluation 가로 may be complex.

If the optional argument opt is 1 or true, the result is multiplied by exp (-I*가로) for k = 1 or exp (I*가로) for k = 2.

If alpha is a scalar, the result is the same size as 가로. If 가로 is a scalar, the result is the same size as alpha. If alpha is a row vector and 가로 is a column vector, the result is a matrix with length (가로) rows and length (alpha) columns. Otherwise, alpha and 가로 must conform and the result will be the same size.

If requested, ierr contains the following status information and is the same size as the result.

  1. Normal return.
  2. Input error, return NaN.
  3. Overflow, return Inf.
  4. Loss of significance by argument reduction results in less than half of machine accuracy.
  5. Complete loss of significance by argument reduction, return NaN.
  6. Error—no computation, algorithm termination condition not met, return NaN.

같이 보기: besselj, bessely, besseli, besselk.

beta (a, b)

Compute the Beta function for real inputs a and b.

The Beta function definition is

beta (a, b) = gamma (a) * gamma (b) / gamma (a + b).

The Beta function can grow quite large and it is often more useful to work with the logarithm of the output rather than the function directly. See betaln, for computing the logarithm of the Beta function in an efficient manner.

같이 보기: betaln, betainc, betaincinv.

betainc (가로, a, b)
betainc (가로, a, b, tail)

Compute the incomplete beta function.

This is defined as

               x
              /
             |
I_x (a, b) = | t^(a-1) (1-t)^(b-1) dt
             |
             /
            0

with real 가로 in the range [0,1]. The inputs a and b must be real and strictly positive (> 0). If one of the inputs is not a scalar then the other inputs must be scalar or of compatible dimensions.

By default, tail is "lower" and the incomplete beta function integrated from 0 to 가로 is computed. If tail is "upper" then the complementary function integrated from 가로 to 1 is calculated. The two choices are related by

betainc (가로, a, b, "upper") = 1 - betainc (가로, a, b, "lower").

betainc uses a more sophisticated algorithm than subtraction to get numerically accurate results when the "lower" value is small.

Reference: A. Cuyt, V. Brevik Petersen, B. Verdonk, H. Waadeland, W.B. Jones, Handbook of Continued Fractions for Special Functions, ch. 18.

같이 보기: beta, betaincinv, betaln.

betaincinv (세로, a, b)
betaincinv (세로, a, b, "lower")
betaincinv (세로, a, b, "upper")

Compute the inverse of the normalized incomplete beta function.

The normalized incomplete beta function is defined as

               x
              /
             |
I_x (a, b) = | t^(a-1) (1-t)^(b-1) dt
             |
             /
            0

If two inputs are scalar, then betaincinv (세로, a, b) is returned for each of the other inputs.

If two or more inputs are not scalar, the sizes of them must agree, and betaincinv is applied element-by-element.

The variable 세로 must be in the interval [0,1], while a and b must be real and strictly positive.

By default, tail is "lower" and the inverse of the incomplete beta function integrated from 0 to 가로 is computed. If tail is "upper" then the complementary function integrated from 가로 to 1 is inverted.

The function is computed by standard Newton’s method, by solving

세로 - betainc (가로, a, b) = 0

같이 보기: betainc, beta, betaln.

betaln (a, b)

Compute the natural logarithm of the Beta function for real inputs a and b.

betaln is defined as

betaln (a, b) = log (beta (a, b))

and is calculated in a way to reduce the occurrence of underflow.

The Beta function can grow quite large and it is often more useful to work with the logarithm of the output rather than the function directly.

같이 보기: beta, betainc, betaincinv, gammaln.

bincoeff (n, k)

Return the binomial coefficient of n and k.

The binomial coefficient is defined as

 /   \
 | n |    n (n-1) (n-2) … (n-k+1)
 |   |  = -------------------------
 | k |               k!
 \   /

For example:

bincoeff (5, 2)
   ⇒ 10

In most cases, the nchoosek function is faster for small scalar integer arguments. It also warns about loss of precision for big arguments.

같이 보기: nchoosek.

commutation_matrix (m, n)

Return the commutation matrix K(m,n) which is the unique m*n by m*n matrix such that K(m,n) * vec(A) = vec(A') for all m by n matrices A.

If only one argument m is given, K(m,m) is returned.

See Magnus and Neudecker (1988), Matrix Differential Calculus with Applications in Statistics and Econometrics.

cosint (가로)

Compute the cosine integral function:

            +oo
           /
Ci (x) = - | (cos (t)) / t dt
           /
          x

An equivalent definition is

                             x
                            /
                            |  cos (t) - 1
Ci (x) = gamma + log (x) +  | -------------  dt
                            |        t
                            /
                           0

Reference:

M. Abramowitz and I.A. Stegun, Handbook of Mathematical Functions 1964.

같이 보기: sinint, expint, cos.

duplication_matrix (n)

Return the duplication matrix Dn which is the unique n^2 by n*(n+1)/2 matrix such that Dn vech (A) = vec (A) for all symmetric n by n matrices A.

See Magnus and Neudecker (1988), Matrix Differential Calculus with Applications in Statistics and Econometrics.

dawson (z)

Compute the Dawson (scaled imaginary error) function.

The Dawson function is defined as

(sqrt (pi) / 2) * exp (-z^2) * erfi (z)

같이 보기: erfc, erf, erfcx, erfi, erfinv, erfcinv.

[sn, cn, dn, 오류] = ellipj (u, m)
[sn, cn, dn, 오류] = ellipj (u, m, tol)

Compute the Jacobi elliptic functions sn, cn, and dn of complex argument u and real parameter m.

If m is a scalar, the results are the same size as u. If u is a scalar, the results are the same size as m. If u is a column vector and m is a row vector, the results are matrices with length (u) rows and length (m) columns. Otherwise, u and m must conform in size and the results will be the same size as the inputs.

The value of u may be complex. The value of m must be 0 ≤ m ≤ 1.

The optional input tol is currently ignored (매트랩 uses this to allow faster, less accurate approximation).

If requested, 오류 contains the following status information and is the same size as the result.

  1. Normal return.
  2. Error—no computation, algorithm termination condition not met, return NaN.

Reference: Milton Abramowitz and Irene A Stegun, Handbook of Mathematical Functions, Chapter 16 (Sections 16.4, 16.13, and 16.15), Dover, 1965.

같이 보기: ellipke.

k = ellipke (m)
k = ellipke (m, tol)
[k, e] = ellipke (…)

Compute complete elliptic integrals of the first K(m) and second E(m) kind.

m must be a scalar or real array with -Inf ≤ m ≤ 1.

The optional input tol controls the stopping tolerance of the algorithm and defaults to eps (class (m)). The tolerance can be increased to compute a faster, less accurate approximation.

When called with one output only elliptic integrals of the first kind are returned.

Mathematical Note:

Elliptic integrals of the first kind are defined as

         1
        /               dt
K (m) = | ------------------------------
        / sqrt ((1 - t^2)*(1 - m*t^2))
       0

Elliptic integrals of the second kind are defined as

         1
        /  sqrt (1 - m*t^2)
E (m) = |  ------------------ dt
        /  sqrt (1 - t^2)
       0

Reference: Milton Abramowitz and Irene A. Stegun, Handbook of Mathematical Functions, Chapter 17, Dover, 1965.

같이 보기: ellipj.

erf (z)

Compute the error function.

The error function is defined as

                        z
              2        /
erf (z) = --------- *  | e^(-t^2) dt
          sqrt (pi)    /
                    t=0

같이 보기: erfc, erfcx, erfi, dawson, erfinv, erfcinv.

erfc (z)

Compute the complementary error function.

The complementary error function is defined as - erf (z).

같이 보기: erfcinv, erfcx, erfi, dawson, erf, erfinv.

erfcx (z)

Compute the scaled complementary error function.

The scaled complementary error function is defined as

exp (z^2) * erfc (z)

같이 보기: erfc, erf, erfi, dawson, erfinv, erfcinv.

erfi (z)

Compute the imaginary error function.

The imaginary error function is defined as

-i * erf (i*z)

같이 보기: erfc, erf, erfcx, dawson, erfinv, erfcinv.

erfinv (가로)

Compute the inverse error function.

The inverse error function is defined such that

erf (세로) == 가로

같이 보기: erf, erfc, erfcx, erfi, dawson, erfcinv.

erfcinv (가로)

Compute the inverse complementary error function.

The inverse complementary error function is defined such that

erfc (세로) == 가로

같이 보기: erfc, erf, erfcx, erfi, dawson, erfinv.

expint (가로)

Compute the exponential integral.

The exponential integral is defined as:

           +oo
          /
          | exp (-t)
E_1 (x) = | -------- dt
          |    t
          /
         x

Note: For compatibility, this function uses the 매트랩 definition of the exponential integral. Most other sources refer to this particular value as E_1 (x), and the exponential integral as

            +oo
           /
           | exp (-t)
Ei (x) = - | -------- dt
           |    t
           /
         -x

The two definitions are related, for positive real values of 가로, by E_1 (-x) = -Ei (x) - i*pi.

References:

M. Abramowitz and I.A. Stegun, Handbook of Mathematical Functions, 1964.

N. Bleistein and R.A. Handelsman, Asymptotic expansions of integrals, 1986.

같이 보기: cosint, sinint, exp.

gamma (z)

Compute the Gamma function.

The Gamma function is defined as

             infinity
            /
gamma (z) = | t^(z-1) exp (-t) dt.
            /
         t=0

Programming Note: The gamma function can grow quite large even for small input values. In many cases it may be preferable to use the natural logarithm of the gamma function (gammaln) in calculations to minimize loss of precision. The final result is then exp (result_using_gammaln).

같이 보기: gammainc, gammaln, factorial.

gammainc (가로, a)
gammainc (가로, a, tail)

Compute the normalized incomplete gamma function.

This is defined as

                                x
                       1       /
gammainc (x, a) = ---------    | exp (-t) t^(a-1) dt
                  gamma (a)    /
                            t=0

with the limiting value of 1 as 가로 approaches infinity. The standard notation is P(a,x), e.g., Abramowitz and Stegun (6.5.1).

If a is scalar, then gammainc (가로, a) is returned for each element of 가로 and vice versa.

If neither 가로 nor a is scalar then the sizes of 가로 and a must agree, and gammainc is applied element-by-element. The elements of a must be non-negative.

By default, tail is "lower" and the incomplete gamma function integrated from 0 to 가로 is computed. If tail is "upper" then the complementary function integrated from 가로 to infinity is calculated.

If tail is "scaledlower", then the lower incomplete gamma function is multiplied by gamma(a+1)*exp(x)/(x^a). If tail is "scaledupper", then the upper incomplete gamma function is multiplied by the same quantity.

References:

M. Abramowitz and I.A. Stegun, Handbook of mathematical functions, Dover publications, Inc., 1972.

W. Gautschi, A computational procedure for incomplete gamma functions, ACM Trans. Math Software, pp. 466–481, Vol 5, No. 4, 2012.

W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical Recipes in Fortran 77, ch. 6.2, Vol 1, 1992.

같이 보기: gamma, gammaincinv, gammaln.

gammaincinv (세로, a)
gammaincinv (세로, a, tail)

Compute the inverse of the normalized incomplete gamma function.

The normalized incomplete gamma function is defined as

                                x
                       1       /
gammainc (x, a) = ---------    | exp (-t) t^(a-1) dt
                  gamma (a)    /
                            t=0

and gammaincinv (gammainc (가로, a), a) = 가로 for each non-negative value of 가로. If a is scalar then gammaincinv (세로, a) is returned for each element of 세로 and vice versa.

If neither 세로 nor a is scalar then the sizes of 세로 and a must agree, and gammaincinv is applied element-by-element. The variable 세로 must be in the interval [0,1] while a must be real and positive.

By default, tail is "lower" and the inverse of the incomplete gamma function integrated from 0 to 가로 is computed. If tail is "upper", then the complementary function integrated from 가로 to infinity is inverted.

The function is computed with Newton’s method by solving

세로 - gammainc (가로, a) = 0

Reference: A. Gil, J. Segura, and N. M. Temme, Efficient and accurate algorithms for the computation and inversion of the incomplete gamma function ratios, SIAM J. Sci. Computing, pp. A2965–A2981, Vol 34, 2012.

같이 보기: gammainc, gamma, gammaln.

l = legendre (n, 가로)
l = legendre (n, 가로, normalization)

Compute the associated Legendre function of degree n and order m = 0 … n.

The value n must be a real non-negative integer.

가로 is a vector with real-valued elements in the range [-1, 1].

The optional argument normalization may be one of "unnorm", "sch", or "norm". The default if no normalization is given is "unnorm".

When the optional argument normalization is "unnorm", compute the associated Legendre function of degree n and order m and return all values for m = 0 … n. The return value has one dimension more than 가로.

The associated Legendre function of degree n and order m:

 m         m      2  m/2   d^m
P(x) = (-1) * (1-x  )    * ----  P(x)
 n                         dx^m   n

with Legendre polynomial of degree n:

          1    d^n   2    n
P(x) = ------ [----(x - 1) ]
 n     2^n n!  dx^n

legendre (3, [-1.0, -0.9, -0.8]) returns the matrix:

 x  |   -1.0   |   -0.9   |   -0.8
------------------------------------
m=0 | -1.00000 | -0.47250 | -0.08000
m=1 |  0.00000 | -1.99420 | -1.98000
m=2 |  0.00000 | -2.56500 | -4.32000
m=3 |  0.00000 | -1.24229 | -3.24000

When the optional argument normalization is "sch", compute the Schmidt semi-normalized associated Legendre function. The Schmidt semi-normalized associated Legendre function is related to the unnormalized Legendre functions by the following:

For Legendre functions of degree n and order 0:

  0      0
SP(x) = P(x)
  n      n

For Legendre functions of degree n and order m:

  m      m         m    2(n-m)! 0.5
SP(x) = P(x) * (-1)  * [-------]
  n      n              (n+m)!

When the optional argument normalization is "norm", compute the fully normalized associated Legendre function. The fully normalized associated Legendre function is related to the unnormalized associated Legendre functions by the following:

For Legendre functions of degree n and order m

  m      m         m    (n+0.5)(n-m)! 0.5
NP(x) = P(x) * (-1)  * [-------------]
  n      n                  (n+m)!
gammaln (가로)
lgamma (가로)

Return the natural logarithm of the gamma function of 가로.

같이 보기: gamma, gammainc.

psi (z)
psi (k, z)

Compute the psi (polygamma) function.

The polygamma functions are the kth derivative of the logarithm of the gamma function. If unspecified, k defaults to zero. A value of zero computes the digamma function, a value of 1, the trigamma function, and so on.

The digamma function is defined:

psi (z) = d (log (gamma (z))) / dx

When computing the digamma function (when k equals zero), z can have any value real or complex value. However, for polygamma functions (k higher than 0), z must be real and non-negative.

같이 보기: gamma, gammainc, gammaln.

sinint (가로)

Compute the sine integral function:

           x
          /
Si (x) =  | sin (t) / t dt
          /
         0

Reference: M. Abramowitz and I.A. Stegun, Handbook of Mathematical Functions, 1964.

같이 보기: cosint, expint, sin.


다음: , 이전: , 상위 문서: Arithmetic   [차례][찾아보기]