📄 pathfunctionalhistogram.java
字号:
/* WARANTY NOTICE AND COPYRIGHTThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.Copyright (C) Michael J. Meyermatmjm@mindspring.comspyqqqdia@yahoo.com*//* * MaximumFunctionalHistogram.java * * Created on March 29, 2002, 6:44 AM */package Examples.Probability;import Statistics.*;import Processes.*;import java.lang.Math.*;/** <p>Displays a histogram of the run time maximum of a standard Brownian * motion (200,000 paths, 100 bins). Writes the file hist.dat for input into * the gri-script histogram.gri. Example program to show how to * define and analyze a path functional.</p> * * @author Michael J. Meyer */public class PathFunctionalHistogram extends MaximumPathFunctional{ /** Allocate the path maximum of a standard Brownian motion * starting at 0. */ public PathFunctionalHistogram() { super(new BrownianMotion(100,0.01,0)); } /** Display the histogram of the functional (<code>this</code>) * over 200,000 paths using 100 bins. */ public static void main(String[] args) { try{ PathFunctionalHistogram H=new PathFunctionalHistogram(); String filename="BmaxHisto.eps"; H.displayHistogram (200000,100,false,filename,Graphics.Flag.EPS); System.out.println("Now writing gri data file."); filename="BmaxHisto.dat"; H.basicHistogram(200000, 100, 0.005).writeGriDataFile("BmaxHisto.dat"); System.out.println("Finished."); }catch(java.io.IOException e){ System.out.println("Could not write to file."); } } } // end PathFunctionalHistogram
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -