How to calculate Yaghoobi Fractal dimension

조회 수: 5 (최근 30일)
reza yaghoobi
reza yaghoobi 2021년 7월 2일
편집: reza yaghoobi 2021년 7월 12일
How to calculate the Yaghoobi fractal dimension for a high dimension trajectory in the high dimensional phase space.
Article title: A new approach to measure the fractal dimension of a trajectory in the high-dimensional phase space
  댓글 수: 1
reza yaghoobi
reza yaghoobi 2021년 7월 2일
function main()
clc;clear all;close all
Kmax = 8;
Y = randn(55,4);
F = YaghoobiFractalDimension(Y,Kmax);
end
function YFD = YaghoobiFractalDimension(Y,Kmax)
%% Estimate Yaghoobi fractal dimension
% Y: a high dimension trajectory
% Kmax: The length of actions
% YFD: Fractal Dimension of the input signal
dim = size(Y,2);
N = size(Y,1);
for k = 1:Kmax
clear xx L
for i = 1:k
a = Y(i:k:(i+fix((N-i)/k)*k),:);
d = diff(a);
r = sqrt(sum(d.^2,2));
alpha = [N-1]/(k*floor([N-i]/k));
L(i) = alpha*sum(r)/(k^(dim-1));
end
LM(k) = mean(L);
end
LM(LM==0)=1e-200;
lLM = log10(LM);
lk = log10(1:Kmax);
lk(LM==0) = [];
lLM(LM==0) =[];
%% LSE
[a,b] = LSE(lk,lLM);
%% Plot
plot(lk,a*lk+b,':k');hold on
plot(lk,lLM,'.','MarkerSize',15);
xlabel('Log_1_0(k)')
ylabel('Log_1_0(L_k)')
xlim([lk(1) lk(end)])
YFD = abs(a);
title(['FD = ',num2str(YFD)])
end
%% fitting
function [a,b] = LSE(x,y)
N = size(x,2);
a = [N*x*y'-sum(x)*sum(y)]/[N*sum(x.^2)-sum(x)^2];
b = [sum(x.^2)*sum(y)-x*y'*sum(x)]/[N*sum(x.^2)-sum(x)^2];
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fractals에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by