Code Monkey home page Code Monkey logo

diffusion-forecast's Introduction

{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
{\fonttbl\f0\fswiss\fcharset0 ArialMT;\f1\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;\red26\green26\blue26;}
\margl1440\margr1440\vieww24340\viewh13000\viewkind0
\deftab720
\pard\pardeftab720

\f0\fs26 \cf2 \expnd0\expndtw0\kerning0
This code implements the data-driven forecasting algorithm developed by Tyrus Berry, Dimitrios Giannakis, and John Harlim in \'93Nonparametric forecasting of low-dimensional dynamical systems\'94. \'a0This implementation uses the variable bandwidth diffusion maps (VBDM) algorithm developed by Tyrus Berry and John Harlim in "Variable Bandwidth Diffusion Kernels".\
\
The main folder contains two script files, "torusExample.m" and "L63Example.m" which reproduce the first two examples of \'93Nonparametric forecasting of low-dimensional dynamical systems\'94. \'a0The folder "ExampleDynamics" contains functions which integrate the models in the examples. \'a0The folder "DiffusionForecast" contains the functions which build the data driven model.\
\
DiffusionForecast/BuildModelVBDM.m - Given a time series, this functions builds a data-driven forecast model, including a basis of smooth functions and a forecasting operator projected into the basis. \'a0\
\
DiffusionForecast/VBDM.m - Estimates the sampling/invariant measure of the time series and builds a basis of smooth functions on the manifold defined by the data set.\
\
BASIC USAGE\
\
Given an N-x-n time series "trainingData" which consists of N data points in R^n build the nonparametric model by calling:\
\
\pard\pardeftab720

\f1\fs20 \cf2 \expnd0\expndtw0\kerning0
[basis,ForwardOp,peq,qest,normalizer,delayEmbedding] = BuildModelVBDM(trainingData,M,k,k2,delays);
\f0\fs26 \expnd0\expndtw0\kerning0
\

\f1\fs20 \expnd0\expndtw0\kerning0
\
\pard\pardeftab720

\f0\fs26 \cf2 \expnd0\expndtw0\kerning0
Were "M" is the number of basis elements desired (0<M<N), "k" is the number of nearest neighbors used in VBDM (larger may improve results but will require more memory), "k2" is the number of neighbors used in the initial density estimate (larger "k2" gives a smoother basis), and "delays" is an optional vector containing lag lengths to use in a time delay embedding. \
\
Given an initial density p(x,0) construct an N-x-1 vector p_i = p(trainingData(i,:),0) then project the density into the basis by the Monte-Carlo integral:\
\pard\pardeftab720

\f1\fs20 \cf2 \expnd0\expndtw0\kerning0
\
c = basis'*(p./qest)/N;\
\pard\pardeftab720

\f0\fs26 \cf2 \expnd0\expndtw0\kerning0
\
To forecast, multiply the coefficients "c" by the matrix "ForwardOp".\
\pard\pardeftab720

\f1\fs20 \cf2 \expnd0\expndtw0\kerning0
\
c = ForwardOp*c;
\f0\fs26 \expnd0\expndtw0\kerning0
\

\f1\fs20 \expnd0\expndtw0\kerning0
\
\pard\pardeftab720

\f0\fs26 \cf2 \expnd0\expndtw0\kerning0
This can be repeated "s" times in order to forecast "s" time steps into the future. The "ForwardOp" may not numerically maintain the density normalization, so renormalize the coefficients by:\
\pard\pardeftab720

\f1\fs20 \cf2 \expnd0\expndtw0\kerning0
\
c = c/(normalizer*c);\
\
\pard\pardeftab720

\f0\fs26 \cf2 \expnd0\expndtw0\kerning0
Finally, reconstruct the forecast density by:
\f1\fs20 \expnd0\expndtw0\kerning0
\
\
recon = peq.*(basis*c);\

\f0\fs26 \expnd0\expndtw0\kerning0
\
The vector "recon" will be N-x-1 and recon_i = p(trainingData(i,:),s*tau) represents the density at the future time "s*tau" where "tau" is the time step of the training time series.}

diffusion-forecast's People

Contributors

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