资源简介
matlab下的幂律拟合函数
先构造函数 然后验证是否拟合效果好
代码片段和文件信息
function [pgof]=plpva(x xmin varargin)
% PLPVA calculates the p-value for the given power-law fit to some
% data.计算了P值 实现数据和幂率分布的拟合
% Source: http://www.santafe.edu/~aaronc/powerlaws/
%
% PLPVA(x xmin) takes data x and given lower cutoff for the power-law
% behavior xmin and computes the corresponding p-value for the
% Kolmogorov-Smirnov test according to the method described in
% Clauset Shalizi Newman (2007).函数xmin指的是截断位置
% PLPVA automatically detects whether x is composed of real or integer
% values and applies the appropriate method. For discrete data if
% min(x) > 1000 PLPVA uses the continuous approximation which is
% a reliable in this regime.
%
% The fitting procedure works as follows:
% 1) For each possible choice of x_min we estimate alpha via the
% method of maximum likelihood and calculate the Kolmogorov-Smirnov
% goodness-of-fit statistic D.
% 2) We then select as our estimate of x_min the value that gives the
% minimum value D over all values of x_min.
%
% Note that this procedure gives no estimate of the uncertainty of the
% fitted parameters nor of the validity of the fit.
%
% Example:
% x = (1-rand(100001)).^(-1/(2.5-1));
% [p gof] = plpva(x 1);
%
% For more information try ‘type plpva‘
%
% See also PLFIT PLVAR
% Version 1.0 (2007 May)
% Version 1.0.2 (2007 September)
% Version 1.0.3 (2007 September)
% Version 1.0.4 (2008 January)
% Version 1.0.5 (2008 March)
% Version 1.0.6 (2008 April)
% Version 1.0.7 (2009 October)
% Copyright (C) 2008-2009 Aaron Clauset (Santa Fe Institute)
% Distributed under GPL 2.0
% http://www.gnu.org/copyleft/gpl.html
% PLPVA comes with ABSOLUTELY NO WARRANTY
%
% Notes:
%
% 1. In order to implement the integer-based methods in Matlab the numeric
% maximization of the log-likelihood function was used. This requires
% that we specify the range of scaling parameters considered. We set
% this range to be [1.50 : 0.01 : 3.50] by default. This vector can be
% set by the user like so
%
% p = plpva(x 1‘range‘[1.001:0.001:5.001]);
%
% 2. PLPVA can be told to limit the range of values considered as estimates
% for xmin in two ways. First it can be instructed to sample these
% possible values like so
%
% a = plpva(x1‘sample‘100);
%
% which uses 100 uniformly distributed values on the sorted list of
% unique values in the data set. Second it can simply omit all
% candidates above a hard limit like so
%
% a = plpva(x1‘limit‘3.4);
%
% Finally it can be forced to use a fixed value like so
%
% a = plpva(x1‘xmin‘1);
%
% In the case of discrete data it rounds the limit to the nearest
% integer.
%
% 3. The default number of semiparametric repetitions of the fitting
% procedure is 1000. This number can be changed like so
%
% p = plvar(x 1‘reps‘10000);
%
% 4. To silence the textual outpu
- 上一篇:多种图像处理的方法 matlab
- 下一篇:matlab 目标检测算法
相关资源
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
评论
共有 条评论