Main Content

psi

ディガンマ関数とポリガンマ関数

説明

Y = psi(X) は、配列 X の各要素についてディガンマ関数を評価します。各要素は非負の実数でなければなりません。

Y = psi(k,X) は、Xポリガンマ関数を評価します。これは、X のディガンマ関数の k 次導関数です。したがって、psi(0,X) はディガンマ関数、psi(1,X) はトリガンマ関数、psi(2,X) はテトラガンマ関数のようになります。

すべて折りたたむ

関数 psi を使用して、オイラーの定数とも呼ばれるオイラー・マスケローニ定数 γ を評価します。

format long
Y = -psi(1)
Y = 
   0.577215664901532

2 のトリガンマ関数を評価します。

format long
Y1 = psi(1,2)
Y1 = 
   0.644934066848226

結果が π2/6-1 と等しくなることを確認します。

Y2 = pi^2/6 - 1
Y2 = 
   0.644934066848226

isequal(Y1,Y2)
ans = logical
   1

領域を定義します。

X = 0:0.05:5;

ディガンマ関数と次の 3 つのポリガンマ関数を計算します。

Y = zeros(4,101);
for i = 0:3
    Y(i+1,:) = psi(i,X);
end

ディガンマ関数と次の 3 つのポリガンマ関数をプロットします。

plot(X,Y)
axis([0 5 -10 10])
legend('\psi','\psi_1','\psi_2','\psi_3','Location','Best')
title('Digamma and The Next Three Polygamma Functions','interpreter','latex')
xlabel('$x$','interpreter','latex')
ylabel('$\psi_k(x)$','interpreter','latex')

Figure contains an axes object. The axes object with title Digamma and The Next Three Polygamma Functions, xlabel $x$, ylabel psi indexOf k baseline leftParenthesis x rightParenthesis contains 4 objects of type line. These objects represent \psi, \psi_1, \psi_2, \psi_3.

入力引数

すべて折りたたむ

入力。非負の実数のスカラー、ベクトル、行列、または多次元配列として指定します。X をスパースにすることはできません。

データ型: single | double

導関数の次数。非負の整数スカラーとして指定します。k231-1 より小さくなければなりません。

データ型: single | double

詳細

すべて折りたたむ

ディガンマ関数

ディガンマ関数は、関数gammaの対数の 1 次導関数です。

ψ(x)=ddxlnΓ(x)=Γ(x)Γ(x).

ポリガンマ関数

次数 k のポリガンマ関数は、ガンマ関数の対数の (k + 1) 次導関数です。

ψ(k)(x)=dk+1dxk+1lnΓ(x)=dkdxkψ(x).

参照

[1] Abramowitz, M. and I. A. Stegun, Handbook of Mathematical Functions, Dover Publications, 1965, Sections 6.3 and 6.4.

拡張機能

バージョン履歴

R2006a より前に導入