GithubHelp home page GithubHelp logo

jmischun / dragon_kings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nonabelian/dragon_kings

0.0 1.0 0.0 1.18 MB

Log-periodic power laws for critical phenomena

License: GNU General Public License v3.0

Python 100.00%

dragon_kings's Introduction

Log-Periodic Power Laws

Log-periodic power law (LPPL) type behavior is interesting for a number of reasons. There is a certain amount of empirical evidence and belief that it is fundamental to many critical phenomena -- material rupture, earthquakes, and financial bubbles, to name a few. For a bit of background see the docs and follow the references!

Here we consider the following generic log-periodic model:

LPPL Equation

Non-linear fitting vs. Heuristic fitting

Interestingly, LPPL is in a class of functions which have many local minima, when attempting to fit. This means that generic fits are pretty terrible, as can be seen here. Additionally there is the curious feature that, if we attempt to fit a least squares slightly away from the true parameter values, we still may never find the global minimum, or the best fit. This can be seen in the following graph, where the parameters are

	p_true = {20, 2, 1, -2, 0.5, 3.0}

and the initial search parameters are

	p_initial = {21, 2, 1, -2, 0.5, 3.0}

with

	p_fit = {21.4, 2, 1, -2, 0.5, 3.0}.

Nonlinear LS

There are a number of solutions to this problem, many of which require heuristic algorithms, which will find good solutions in these situations. For the situation of many local minima, the algorithms generically hop around parameter space, with some probability. This is in contrast to many fitting methods that zero in on the minimum, and are likely to get trapped. These heuristic algorithms include: simulated annealing, evolutionary algorithms, tabu search, and others.

Below we have scipy's basinhopping fit, where the parameters are

	p_true = {20, 2, 2, 0.5, 3}

and the initial search parameters are

	p_initial = {1, 1, 1, 1, 1}

with

	p_fit = {20.00, 2.01, 0.95, 0.50, 1.0, 2.94}

Basinhopping Fit

dragon_kings's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.