The R source code of the function for the detection of change-points is downloadable here [mbass.r (~2.4 kB)]. It needs a list of magnitude values in vector 'a'. The file [NIED subset magnitudes (~125 kB)] includes the 31,240 magnitudes values from the subset of the earthquake catalogue maintained by the National Research Institute for Earth Science and Disaster Prevention (NIED). In the source code, the 'fmbass' function performs the raw MBASS procedure whereas the 'mbass' function performs the bootstrap of 'fmbass'. The version of the source code is valid for R>=2.4.0. R is the free statistical programming language (Ihaka and Gentleman, 1996) which serves to write the Statistical Seismology Library (Harte, 2006). In the source code, the bootstrap library is the 1.0-20 bootstrap package which includes the functions for the book by Efron and Tibshirani (1993).
Arguments of mbass are :
a : the name of the list of magnitude values.
delta : the magnitude step.
plot : logical specification. If true, the Frequency Magnitude Distribution (FMD) is plotted.
alldisc : logical specification. If true, accurate information about the detected change-points are printed.
bs : the number of bootstrap replicates required. If this value is zero, only the actual FMD is analysed.
A sample R session involving MBASS may look like the following:
> source("mbass.r") > x=read.table("niedmag.d") > a=x[,1] > y=mbass(a,delta=0.1,plot=F,alldisc=F,bs=1000) > quantile(y$thetastar[1,],probs=c(0.05,0.5,0.95),na.rm=T) 5% 50% 95% 1.2 1.3 1.5
These values are respectively the 5th, 50th (median) and 95th percentile of the distribution of the main magnitude discontinuity (m0) for the NIED data subset. These percentiles are computed from 1000 bootstrap replicates of the Frequency Magnitude Distribution (FMD).
If the following lines are added to the session :
> miny=min(y$thetastar[1,],na.rm=T) > maxy=max(y$thetastar[1,],na.rm=T) > hist(y$thetastar[1,],main="Main discontinuity",xlab="Discontinuity magnitude",ylim=c(0,1000),breaks=seq(miny-0.05,maxy+0.1,0.1))
Then, the session draws the histogram of the main discontinuity in magnitude for the 1000 replicated FMDs. Changing '1' into '2' in 'y$thetastar[1,]' will allow obtaining the same results for the auxiliary magnitude discontinuity.
Efron, B. and R. Tibshirani (1993). An introduction to the bootstrap. Chapman and Hall, New York, 436 pp.
Ihaka, R. and R. Gentleman (1996). R: A language for data analysis and graphics, J. Comput. Graph. Stat. , 5, 299-314.
Harte, D. (2006). Users guide for the statistical seismological library, URL: http://www.statsresearch.co.nz/software.html
Tech Note: R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Microsoft Windows and Mac OS X. For more information see: http://www.r-project.com.
[
Back
]