声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2152|回复: 3

[分形与混沌] 求助 分形维函数中的参数 ss甚么意思 如何选取

[复制链接]
发表于 2006-12-11 19:09 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
function [ln_r,ln_C]=G_P(data,N,tau,min_m,max_m,ss)
% the function is used to calculate correlation dimention with G-P algorithm
% data:the time series
% N: the length of the time series       %时间序列的长度
% tau: the time delay                        %  时间间隔,是采样时间t的整数倍
% min_m:the least embedded dimention m     % 最小嵌入维数  
% max_m:the largest embedded dimention m   % 最大 嵌入维数
% ss:the stepsize of r
%skyhawk

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2006-12-16 08:31 | 显示全部楼层
你找G_P算法的资料看一下就很清楚了
发表于 2007-3-30 14:20 | 显示全部楼层
同样的问题不明白~~能不能详细说一下~~
发表于 2007-4-16 04:49 | 显示全部楼层
G-P算法计算时间序列关联维数的C程序
该程序转载于《分形与混沌——blog》
再次声明是转载
为了自己的学习,记录别人的好的东东,对true7742表示感谢!

  1. #include "mex.h"
  2. #include "math.h"
  3. /*****************************************************************
  4. *  data:the time series
  5. *  r: the r series
  6. *  N: the length of the time series
  7. *  delay : the delay of the time series
  8. *  rlen: the length of r series
  9. *  ln_C: the correlation dimention series
  10. ******************************************************************/
  11. void G_P(double data[], double r[], int N, int m,
  12.    int rlen, int delay, double ln_C[],double ln_r[])
  13. {
  14. double distance;
  15. double max=0;
  16. int cr=0;
  17. int i,j,k,l;
  18. double Cr=0;
  19. int M=N-(m-1)*delay;
  20. for (l=0; l<rlen; l++)
  21. {
  22.      for (i=0; i<M-1; i++)
  23.   {
  24.       for (j=i+1; j<M; j++)
  25.    {
  26.        for (k=0; k<m; k++)
  27.     {
  28.     distance = fabs(data[i+k*delay]-data[j+k*delay]);
  29.     if (distance>max)
  30.      max = distance;
  31.     }
  32.        if (r[l]>=max)
  33.         cr++;
  34.        max = 0;
  35.    }
  36.   }
  37.   Cr = cr*2.0/(M*(M-1));
  38.   cr = 0;
  39.         ln_C[l] = log(Cr);
  40.         ln_r[l] = log(r[l]);  
  41. }
  42. }
  43. void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
  44. {
  45. double *data;
  46. double *r;
  47. int m;
  48. int delay;
  49. double *ln_C;
  50. double *ln_r;
  51. int datalen,rlen;
  52. if (nrhs!=4)
  53.   mexErrMsgTxt("Four inputs required!");
  54. else if (nlhs>2)
  55.   mexErrMsgTxt("Too many output arguments!");
  56. datalen = mxGetN(prhs[0]);
  57. rlen = mxGetN(prhs[1]);
  58. m = mxGetScalar(prhs[2]);
  59. delay = mxGetScalar(prhs[3]);
  60.     //define the two output arguments
  61. plhs[0] = mxCreateDoubleMatrix(1,rlen,mxREAL);
  62. plhs[1] = mxCreateDoubleMatrix(1,rlen,mxREAL);
  63. data = mxGetPr(prhs[0]);
  64. r = mxGetPr(prhs[1]);
  65. ln_C = mxGetPr(plhs[0]);
  66. ln_r = mxGetPr(plhs[1]);
  67. G_P(data,r,datalen,m,rlen,delay,ln_C,ln_r);
  68. }
复制代码


看了上面的代码,我想大家应该就清楚了,其中rlen就是大家上面提到的SS
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-19 09:35 , Processed in 0.168068 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表