📄 demomrw
字号:
#..........................................................................## ## L a s t W a v e P a c k a g e 'mrw' 1.0 ## ## Copyright (C) 2008 Emmanuel Bacry. ## email : lastwave@cmap.polytechnique.fr ## ##..........................................................................## ## This program is a free software, you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program (in a file named COPYRIGHT); ## if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ##..........................................................................################################################### This is a demo file for the mrw package# #################################################setproc DemoMRW {} "{{{} {Demonstration of the MRW package : simulation/estimation}}}" { global System StartDemo DemoMRW}setproc _DemoMRW0 {} { global &array Demo printf "\n The following code creates MRW realization of size 16384 with parameters along with its associated MRM:\n" printf " (integral scale) T=200\n" printf " (intermittency parameter) lambda2=0.02\n" printf " (volatility) sigma=2\n" printf " The oversampling is 4 (i.e., l=2^{-4})\n\n" printf " -> {mrm mrw} = [mrw 16384 4 200 0.02 2 -M]\n" printf " -> disp MRW mrw -pos 380 60 -size 300 300\n\n" {Demo.mrm Demo.mrw} = [mrw 16384 4 200 0.02 2 -M] disp MRW Demo.mrw -pos 380 60 -size 300 300}setproc _DemoMRW1 {} { printf "\n We want to perform parameter estimation using GMM method. The GMM method is based on the use of MRW increment. For best result we will use increment on the minimum available scale, i.e., tau=1. Moreover GMM uses correlation function of the logarithm of these increments. We need to specify the lags that will be used in this correlation function (lag 0 is forbidden). We will use all the lags from 1 to 40. So in order to run the GMM algorithm we must do \n\n" printf " -> res = [mrwgmm mrw 1:40 0 1]\n\n" printf " When this command is typed it displays intermediate estimation. Go on and it will run this command\n\n"}setproc _DemoMRW2 {} { global Demo Demo.res = [mrwgmm Demo.mrw 1:40 0 1] printf "\n The last line above is the 5%% confidence interval (assuming gaussian asymptotics is reached). The estimation is : \n" printf " -> sigma = exp(res[0][0]) = %g\n" exp(Demo.res[0][0]) printf " -> lambda2 = res[0][1] = %g\n" Demo.res[0][1] printf " -> T = exp(res[0][2]) = %g\n" exp(Demo.res[0][2]) printf " res[1] is the covariance matrix of the error\n\n"}help DemoMRW
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -