## BEAST: A Bayesian Ensemble Algorithm for Change-Point Detection and Time Series Decomposition
<img align="right" height="500" src="https://github.com/zhaokg/Rbeast/raw/master/R/Images/beach.png">
#### BEAST (Bayesian Estimator of Abrupt change, Seasonality, and Trend) is a fast, generic Bayesian model averaging algorithm to decompose time series or 1D sequential data into individual components, such as abrupt changes, trends, and periodic/seasonal variations, as described in <ins>[Zhao et al. (2019)](https://go.osu.edu/beast2019)</ins>. BEAST is useful for changepoint detection (i.e., breakpoints or structural breaks), nonlinear trend analysis, time series decomposition, and time series segmentation. See a list of <ins>[selected studies using BEAST](#selected-publications-using-beastrbeast)</ins>.
> **BEAST** was impemented in C/C++ but accessible from R and Matlab. Check the `Source`, `R`, and `Matlab` folders at [Github](https://github.com/zhaokg/Rbeast) for the C, R, and Matlab code.
**Quick installation**:
* In Matlab, run **`eval(webread('http://b.link/beast',weboptions('cert','')))`**
* In R, run **`install.packages("Rbeast")`**
* Or follow the more detailed instructions below to install and run BEAST
## Installation for R
[![](https://www.r-pkg.org/badges/version/Rbeast?color=green)](https://cran.r-project.org/package=Rbeast)
[![](http://cranlogs.r-pkg.org/badges/grand-total/Rbeast?color=green)](https://cran.r-project.org/package=Rbeast)
In CRAN-Task-View: [[Time Series Analysis]](https://cran.r-project.org/web/views/TimeSeries.html#forecasting-and-univariate-modeling) and [[Bayesian inference]](https://cran.r-project.org/web/views/Bayesian.html#time-series-models)
1. from **CRAN**: An R package **`Rbeast`** has been deposited at [CRAN](https://CRAN.R-project.org/package=Rbeast). (On CRAN, there is another Bayesian time-series package named "beast", which has nothing to do with the BEAST algorithim. Our package is `Rbeast`.) Install it in R using
```R
install.packages("Rbeast")
```
2. from **GitHub**: The latest R versions are also available here at [GitHub](https://github.com/zhaokg/Rbeast) and can be installed using
```R
# Windows x86 or x64 (install from binary)
install.packages("https://github.com/zhaokg/Rbeast/raw/master/R/Windows/Rbeast_0.9.4.zip" ,repos=NULL)
# Linux/Mac (install from source)
install.packages("https://github.com/zhaokg/Rbeast/raw/master/R/Rbeast_0.9.4.tar.gz", repos = NULL, type="source")
```
#### Run and test Rbeast in R
<img align="left" height="330" src="https://github.com/zhaokg/Rbeast/raw/master/R/Images/Nile.png">
The main functions in Rbeast are `beast(Y, ...)`, `beast.irreg(Y, ...)`, and `beast123(Y, metadata, prior, mcmc, extra)`. The code snippet below provides a starting point for the basic usage.
```R
library(Rbeast)
data(Nile) # annual streamflow of the Nile River
out = beast(Nile, season='none') # 'none': trend-only data without seasonlaity
print(out)
plot(out)
?Rbeast # See more details about the usage of `beast`
tetris() # if you dare to waste a few moments of your life
minesweeper() # if you dare to waste a few more moments of your life
```
<br/>
<br/>
<br/>
----
## Installation for Matlab [![View Rbeast on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/72515-rbeast)
Install the Matlab version of BEAST automatically to a local folder of your choice by running
```Matlab
beastPath = 'C:\beast\'
eval( webread('http://b.link/beast') )
% NOTE:
% 1. Write permission needed for your chosen path; the variable name must be 'beastPath'
% 2. If webread has a certificate error, run the following line instead:
% eval( webread( 'http://b.link/beast', weboptions('cert','') ) );
```
The above will download all the files in the [Rbeast\Matlab folder at Github](https://github.com/zhaokg/Rbeast) to the chosen folder: if `beastPath` is missing, a default temporary folder (e.g., `C:\Users\$user_name$\AppData\Local\Temp\Rbeast for Windows 10`) will be used. If the automatic script fails, please download the Matlab files from [Github](https://github.com/zhaokg/Rbeast) manually. These files include a Matlab mex library compiled from the C soure code (e.g., `Rbeast.mexw64` for Windows, `Rbeast.mexa64` for Linux, `Rbeast.mexmaci64` for MacOS) and some Matlab wrapper functions (e.g.,`beast.m`, and `beast123.m`) similar to the R interface, as well as some test datasets (e.g., Nile.mat, and co2.mat).
#### Usage
The Matlab API is similar to those of R. Below is a quick example:
```Matlab
help beast
help beast123
load('Nile.mat') % annual streamflow of the Nile River startin from year 1871
out = beast(Nile, 'season', 'none','start', 1871) % trend-only data without seasonality
printbeast(out)
plotbeast(out)
```
We generated the Matlab mex binary library on our own machines with Win10, Ubuntu 22.04, and macOS High Sierra. If they fail on your machine, the mex library can be compiled from the C source code files under `Rbeast\Source`. If needed, we are happy to work with you to compile for your specific OS or machines. Additional information on compilations from the C source is also given below.
----
### Python/Julia
Wrappers in Python and Julia are being developed: We welcome contributions and help from interested developers. If interested, contact Kaiguang Zhao at [email protected].
## Description
Interpretation of time series data is affected by model choices. Different models can give different or even contradicting estimates of patterns, trends, and mechanisms for the same data–a limitation alleviated by the Bayesian estimator of abrupt change,seasonality, and trend (BEAST) of this package. BEAST seeks to improve time series decomposition by forgoing the "single-best-model" concept and embracing all competing models into the inference via a Bayesian model averaging scheme. It is a flexible tool to uncover abrupt changes (i.e., change-points), cyclic variations (e.g., seasonality), and nonlinear trends in time-series observations. BEAST not just tells when changes occur but also quantifies how likely the detected changes are true. It detects not just piecewise linear trends but also arbitrary nonlinear trends. BEAST is applicable to real-valued time series data of all kinds, be it for remote sensing, finance, public health, economics, climate sciences, ecology, and hydrology. Example applications include its use to identify regime shifts in ecological data, map forest disturbance and land degradation from satellite imagery, detect market trends in economic data, pinpoint anomaly and extreme events in climate data, and unravel system dynamics in biological data. Details on BEAST are reported in [Zhao et al. (2019)](https://go.osu.edu/beast2019). The paper is available at https://go.osu.edu/beast2019.
## Reference
>Zhao, K., Wulder, M. A., Hu, T., Bright, R., Wu, Q., Qin, H., Li, Y., Toman, E., Mallick B., Zhang, X., & Brown, M. (2019). [Detecting change-point, trend, and seasonality in satellite time series data to track abrupt changes and nonlinear dynamics: A Bayesian ensemble algorithm.](https://go.osu.edu/beast2019) Remote Sensing of Environment, 232, 111181. (the BEAST paper)
>
>Zhao, K., Valle, D., Popescu, S., Zhang, X. and Mallick, B., 2013. [Hyperspectral remote sensing of plant biochemistry using Bayesian model averaging with variable and band selection](https://www.academia.edu/download/55199778/Hyperspectral-biochemical-Bayesian-chlorophyll-carotenoid-LAI-water-content-foliar-pigment.pdf). Remote Sen
没有合适的资源?快使用搜索试试~ 我知道了~
贝叶斯变点检测和时间序列分解附matlab代码.zip
共126个文件
c:58个
h:40个
m:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 27 浏览量
2023-04-20
10:48:42
上传
评论 2
收藏 1.72MB ZIP 举报
温馨提示
1.版本:matlab2014/2019a,内含运行结果,不会运行可私信 2.领域:智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,更多内容可点击博主头像 3.内容:标题所示,对于介绍可点击主页搜索博客 4.适合人群:本科,硕士等教研学习使用 5.博客介绍:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可si信
资源推荐
资源详情
资源评论
收起资源包目录
贝叶斯变点检测和时间序列分解附matlab代码.zip (126个子文件)
abc_vec_avx512.c 95KB
abc_vec_avx2.c 91KB
beastv2_COREV4_gui.c 88KB
beastv2_COREV4_mthrd.c 85KB
beastv2_COREV4.c 83KB
glue_code.c 59KB
beastv2_io_in_args.c 52KB
beastv2_io_out_allocmem_q.c 43KB
abc_vec_generic.c 42KB
abc_math_avx.c 38KB
beastv2_basis_proposeNew_q.c 35KB
_beastv2_gui_winmain.c 33KB
beastv2_io_out_tsextractprint.c 29KB
abc_ide_util.c 28KB
abc_common.c 28KB
beastv2_prior_precfunc.c 27KB
abc_vec.c 27KB
abc_mat.c 25KB
beastv2_func_q.c 23KB
abc_math_avx512.c 22KB
beastv2_model_allocinit_q.c 21KB
abc_pthread.c 21KB
beastv2_io_out_write_q.c 19KB
abc_cpu.c 18KB
abc_rand_pcg_global.c 15KB
beastv2_basis_gensegment.c 14KB
abc_rand_pcg_local_avx2.c 13KB
abc_lzw.c 12KB
abc_win32_demo.c 12KB
_beastv2_gui_plot.c 11KB
beastv2_basis_updateKsKe_prec0123.c 10KB
abc_svd.c 10KB
abc_date.c 10KB
beastv2_io_out_printargs.c 10KB
abc_rand_pcg_local.c 9KB
beastv2_io_in_readts.c 9KB
abc_rand_pcg_local_avx512.c 8KB
abc_ts_func.c 8KB
abc_mcmc.c 7KB
beastv2_prior_model.c 7KB
beastv2_basis_updategoodvec.c 6KB
beastv2_xxyy_allocmem_q.c 6KB
tetris.c 6KB
beastv2_basis_allocinitmem.c 6KB
abc_mem.c 5KB
beastv2_basis_pickcmptId.c 5KB
abc_math.c 4KB
abc_dir.c 4KB
abc_timer.c 3KB
abc_rand_pcg_local_generic.c 3KB
beastv2_basis_computexy_q.c 3KB
beastv2_basis_genrandbasis.c 3KB
abc_mem_ext.c 3KB
abc_sort.c 3KB
beastv2_basis_cvtKnotsToBinVec.c 2KB
abc_system.c 1KB
abc_ioFlush.c 1KB
globalvars.c 615B
abc_dirent.h 26KB
abc_blas_lapack_myl_old.h 20KB
abc_000_macro.h 18KB
abc_blas_lapack_myl.h 14KB
abc_vec.h 12KB
abc_pthread.h 12KB
beastv2_header.h 12KB
beastv2_header_solaris.h 12KB
abc_001_config.h 7KB
abc_ide_util.h 6KB
beastv2_func.h 5KB
abc_timer.h 4KB
abc_datatype.h 3KB
abc_common.h 3KB
abc_win32_demo.h 3KB
abc_rand_pcg_local.h 3KB
abc_mat.h 2KB
abc_blas_lapack_mkl.h 2KB
abc_mcmc.h 2KB
abc_cpu.h 1KB
abc_math_avx.h 1KB
beastv2_io.h 1KB
abc_mem_ext.h 1KB
abc_rand_pcg_global.h 1KB
beastv2_prior_precfunc.h 1KB
abc_mem.h 1KB
abc_date.h 1KB
abc_ts_func.h 949B
abc_rand_mkl.h 575B
abc_math_avx512.h 516B
globalvars.h 490B
abc_000_warning.h 443B
beastv2_xxyy_allocmem.h 427B
abc_blas_lapack_lib.h 398B
abc_dir.h 304B
abc_math.h 248B
abc_rand.h 191B
abc_sort.h 165B
beastv2_model_allocinit.h 142B
abc_system.h 85B
plotbeast.m 19KB
beast.m 17KB
共 126 条
- 1
- 2
资源评论
Matlab科研辅导帮
- 粉丝: 1w+
- 资源: 7491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功