How to calculate Lyapunov Exponent in R? -
i use following code calculate lyapunov exponent. cannot used calculate lyapunov exponent short time series. suggestion?
# lyapunov exponent if(freq > n-10) stop("insufficient data") ly <- numeric(n-freq) for(i in 1:(n-freq)) { idx <- order(abs(x[i] - x)) idx <- idx[idx < (n-freq)] j <- idx[2] ly[i] <- log(abs((x[i+freq] - x[j+freq])/(x[i]-x[j])))/freq if(is.na(ly[i]) | ly[i]==inf | ly[i]==-inf) ly[i] <- na } lyap <- mean(ly,na.rm=true) flyap <- exp(lyap)/(1+exp(lyap))
Comments
Post a Comment