chis_prb.m

来自「计量工具箱」· M 代码 · 共 31 行

M
31
字号
function prob = chis_prb(x,v)
% PURPOSE: computes the chi-squared probability function
%---------------------------------------------------
% USAGE: prob = chis_prb(x,v)
% where: x = the value to test
%            (may be a matrix size(v), or a scalar)
%        v = the degrees of freedom 
%                (may be a matrix size(x), or a scalar)
%---------------------------------------------------
% RETURNS:
%        prob = the probability of observing a chi-squared
%               value <= x, i.e., prob(x | v).                  
% --------------------------------------------------
% SEE ALSO: chis_d, chis_pdf, chis_cdf, chis_inv, chis_rnd
%---------------------------------------------------

% written by:
% James P. LeSage, Dept of Economics
% University of Toledo
% 2801 W. Bancroft St,
% Toledo, OH 43606
% jlesage@spatial-econometrics.com


if nargin ~= 2
error('Wrong # of arguments to chis_prb');
end;

 prob = gammainc(x/2, v/2);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?