Coder Social home page Coder Social logo

lpplmodel's Introduction

LPPLModel

##简介 LPPLModel使用对数周期幂律模型(Log Period Power Law)求解股票市场的崩盘时间,LPPL模型把股价表示为如下函数
\[
\ln p(t) = A + B(t_c - t)^m + C_1(t_c-t)^2\cos[\omega\ln(t_c-t)]
+ C_2(t_c-t)^m\sin[\omega\ln(t_c-t)]
\]
我们需要求解A,B,C_1,C_2,\omega,m,t_c,这里t_c就是崩盘时间。在求解时,实际上求解了如下优化问题
\[
\min \sum_i [\ln p(t_i) - A - B(t_c - t_i)^m - C_1(t_c-t_i)^2\cos[\omega\ln(t_c-t_i)]
> - C_2(t_c-t_i)^m\sin[\omega\ln(t_c-t_i)]^2
\]

##结构 LPPLModel结构如下

  • TestLPPL.m: 测试文件,如何使用LPPLModel请参看该文件
  • @LPPL: LPPL类
  • Data.mat: 测试数据,为2015年A股崩盘前的上证指数分钟收盘价

LPPLModel中主要包括一个LPPL的handle类,该类有两个成员函数

  • Train(obj, X, Y, t0): 实现模型训练,即获得A,B,C_1,C_2,t_c,m,\omega参数
  • Y = Predict(obj, X): 预测,使用该模型预测时间为X(X<t_c)时的股价,一般用来看模型的拟合情况

lpplmodel's People

Contributors

jiangyc92 avatar

Watchers

faruto 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.