GithubHelp home page GithubHelp logo

zhaokg / rbeast Goto Github PK

View Code? Open in Web Editor NEW
203.0 7.0 36.0 27.03 MB

Bayesian Change-Point Detection and Time Series Decomposition

MATLAB 2.59% C 89.89% C++ 0.02% Python 1.47% R 6.03%
time-series changepoint-detection time-series-decomposition bayesian-time-series trend-analysis breakpoint-detection anomoly-detection interrupted-time-series seasonality-analysis structural-breakpoint

rbeast's Introduction

BEAST: A Bayesian Ensemble Algorithm for Change-Point Detection and Time Series Decomposition

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 Zhao et al. (2019). BEAST is useful for changepoint detection (e.g., breakpoints, structural breaks, regime shifts, or anomalies), trend analysis, time series decomposition (e.g., trend vs seasonality), time series segmentation, and interrupted time series analysis. See a list of selected studies using BEAST .

Quick Installation

BEAST was impemented in C/C++ but accessible from R, Python, Matlab, and Octave. Install it as follows:

  • Python: pip install Rbeast
  • Matlab: eval(webread('http://b.link/rbeast',weboptions('cert','')))
  • Octave: eval(webread('http://b.link/rbeast'))
  • R lang: install.packages("Rbeast")

Quick Usage

One-liner code for Python, Matlab and R:

# Python example
import Rbeast as rb; (Nile, Year)=rb.load_example('nile'); o=rb.beast(Nile,season='none'); rb.plot(o)

# Matlab/Octave example
load('Nile'); o = beast(Nile, 'season','none'); plotbeast(o)

# R example
library(Rbeast); data(Nile); o = beast(Nile); plot(o)

Installation for R

Rbeast in CRAN-TASK-VIEW: [Time Series Analysis] [Bayesian inference] [Environmetrics]

An R package Rbeast has been deposited at CRAN. ( On CRAN, there is another Bayesian time-series package named "beast", which has nothing to do with the BEAST algorithim. Our package is Rbeast. Also, Rbeast has nothing to do with the famous "Bayesian evolutionary analysis by sampling trees" aglorithm.) Install Rbeast in R using

install.packages("Rbeast")

Run and test Rbeast in R

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.

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 

Installation for Matlab

View Rbeast on File Exchange

Install the Matlab version of BEAST automatically to a local folder of your choice by running

beastPath = 'C:\beast\'                   
eval( webread('http://b.link/rbeast') )  

%%%%%%%%%%%%%%%%%%%%%%%%%%% Note on Automatic Installtion %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% 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/rbeast', weboptions('cert','') )  )                       %
% 3. If the automatic installation fails, please manually download all the files (see blow) %       
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The above will download all the files in the Rbeast\Matlab folder at Github 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 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).

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.

Run and test Rbeast in Matlab

The Matlab API is similar to those of R. Below is a quick example:

 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)

Installation for Octave

The same as for Matlab. Now, only Windows platforms are supported. If needed for other platforms (e.g., Octave in Linux and Mac), please contact the author at [email protected] for support.


Installation for Python

A package Rbeast has been deposited at PyPI: https://pypi.org/project/Rbeast/. Run the command below in a console to install:

  pip install Rbeast

Binary wheel files were built on Windows, MacOS, and Linux for Python version 3.7 to 3.11 (either x86_64 or arm64 CPU). If the installation fails, please install from the source to build the package using pip install Rbeast --no-binary :none:, which requies a C/C++ compliler (e.g., requiring gcc on Linux or xcode on Mac). If needed, contact Kaiguang Zhao ([email protected]) to help build the package for your OS platform and Python version.

Run and test Rbeast in Python

Nile is annual streamflow of the River Nile, starting from Year 1871. As annual observations, it has no periodic component (i.e., season='none').

import Rbeast as rb                                       # Import the Rbeast package as `rb`
nile, year = rb.load_example('nile')                      # a sample time series
o          = rb.beast( nile, start=1871, season='none')
rb.plot(o)
rb.print(o)
o  # see a list of output fields in the output variable o

The second example googletrend is a monthly time series of the Google Search popularity of the word beach over the US. This monthly time series is reguarly-spaced (i.e., deltat=1 month =1/12 year); it has a cyclyic component with a period of 1 year. That is, the number of data points per period is period / deltat = 1 year / 1 month = 1/(1/12) = 12.

beach, year = rb.load_example('googletrend')
o = rb.beast(beach, start= 2004.0, deltat=1/12, period = 1.0)       # the time unit is unknown or arbitrary
o = rb.beast(beach, start= 2004.0, deltat=1/12, period ='1.0 year') # the time unit is fractional year
o = rb.beast(beach, start= 2004.0, deltat='1 month', period =1.0)   # the time unit is fractional year
rb.plot(o)
rb.print(o)

Installation for Julia/IDL (yet to come)

Wrappers in Julia and IDL are being developed: We welcome contributions and help from interested developers. If interested, contact Kaiguang Zhao at [email protected].

Description of BEAST

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). The paper is available at https://go.osu.edu/beast2019.

Note on computation

As a Bayesian algorithm, BEAST is fast and is possibly among the fastest implementations of Bayesian time-series analysis algorithms of the same nature. (But it is still slower, compared to nonBayesian methods.) For applications dealing with a few to thousands of time series, the computation won't be an practical concern. But for remote sensing/geospatial applications that may easily involve millions or billions of time series, computation will be a big challenge for Desktop computer users. We suggest first testing BEAST on a single time series or small image chips first to determine whether BEAST is appropriate for your applications and, if yes, estimate how long it may take to process the whole image.

In any case, for those users handling stacked time-series images, do not use beast or beast.irreg. Use beast123 instead, which can handle 3D data cubes and allow parallel computing. We also welcome consultation with Kaiguang Zhao ([email protected]) to give specific suggestions if you see some value of BEAST for your applications.

Reference

Compilation from C source code (for developers and experts only)

Though not needed but if preferred, the code can be compiled for your specific machines. Check the Rbeast\Source folder at GitHub for details.

Reporting Bugs or getting help

BEAST is distributed as is and without warranty of suitability for application. The one distributed above is still a beta version, with potential room for further improvement. If you encounter flaws with the software (i.e. bugs) please report the issue. Providing a detailed description of the conditions under which the bug occurred will help to identify the bug, you can directly email its maintainer Dr. Kaiguang Zhao at [email protected]. Alternatively, Use the Issues tracker on GitHub to report issues with the software and to request feature enhancements.

Acknowledgement:

BEAST is developed by Yang Li, Tongxi Hu, Xuesong Zhang, and Kaiguang Zhao. The development of BEAST received supported through Microsoft Azure for Research (CRM0518513) and a USGS 104B grant and a Harmful Algal Bloom Research Initiative grant from the Ohio Department of Higher Education. The contribution of Xuesong Zhang was supported through USDA-ARS.

Selected publications using BEAST/Rbeast

Despite being published originally for ecological and enviornmental applications, BEAST is developed as a generic tool applicable to time series or time-series-like data arising from all disciplines. BEAST is not a heuristic algorithm but a rigorous statistical model. Below is a list of selected peer-reviewed pulications that used BEAST for statistical data analysis.

Discipline Publication Title
Remote Sensing Li, J., Li, Z., Wu, H., and You, N., 2022. Trend, seasonality, and abrupt change detection method for land surface temperature time-series analysis: Evaluation and improvement. Remote Sensing of Environment, 10.1016/j.rse.2022.113222
Population Ecology Henderson, P. A. (2021). Southwood's Ecological Methods (5th edition). Oxford University Press., page 475-476
Cardiology Ozier, D., Rafiq, T., de Souza, R. and Singh, S.M., 2023. Use of Sacubitril/Valsartan Prior to Primary Prevention Implantable Cardioverter Defibrillator Implantation. CJC Open.
Mechanical Engineering Bao, X., Chen, L., Zhong, J., Wu, D. and Zheng, Y., 2024. A self-supervised contrastive change point detection method for industrial time series. Engineering Applications of Artificial Intelligence, 133, p.108217..
Spatial Ecology Laurin, G.V., Cotrina-Sanchez, A., Belelli-Marchesini, L., Tomelleri, E., Battipaglia, G., Cocozza, C., Niccoli, F., Kabala, J.P., Gianelle, D., Vescovo, L. and Da Ros, L., 2024. Comparing ground below-canopy and satellite spectral data for an improved and integrated forest phenology monitoring system. Ecological Indicators, 158, p.111328.
Psychophysiology Michela, A., 2024. The heart on duty: Training police officers in action using a biofeedback virtual-reality game (Doctoral dissertation, Sl: sn).
Ecology Mehri, S., Alesheikh, A.A. and Lotfata, A., 2024. Abiotic factors impact on oak forest decline in Lorestan Province, Western Iran. Scientific Reports, 14(1), p.3973.
Paleoclimatology Wauthy, S., Tison, J.L., Inoue, M., El Amri, S., Sun, S., Fripiat, F., Claeys, P. and Pattyn, F., 2024. Spatial and temporal variability of environmental proxies from the top 120 m of two ice cores in Dronning Maud Land (East Antarctica). Earth System Science Data, 16(1), pp.35-58.
Paleoclimatology Anastasia Zhuravleva et al., 2023. Caribbean salinity anomalies contributed to variable North Atlantic circulation and climate during the Common Era. Science Advances, DOI:10.1126/sciadv.adg2639
Phenometrics Laurin, G.V., Cotrina-Sanchez, A., Belelli-Marchesini, L., Tomelleri, E., Battipaglia, G., Cocozza, C., Niccoli, F., Kabala, J.P., Gianelle, D., Vescovo, L. and Da Ros, L., 2024. Comparing ground below-canopy and satellite spectral data for an improved and integrated forest phenology monitoring system. Ecological Indicators, 158, p.111328.
Anthropocene Science Thomas, E.R., Vladimirova, D.O., Tetzner, D.R., Emanuelsson, D.B., Humby, J., Turner, S.D., Rose, N.L., Roberts, S.L., Gaca, P. and Cundy, A.B., 2023. The Palmer ice core as a candidate Global boundary Stratotype Section and Point for the Anthropocene series. The Anthropocene Review, p.20530196231155191.
Enviornmental Engineering Ganji, A., Saeedi, M., Lloyd, M., Xu, J., Weichenthal, S. and Hatzopoulou, M., 2024. Air pollution prediction and backcasting through a combination of mobile monitoring and historical on-road traffic emission inventories. Science of The Total Environment, 915, p.170075.
Biomedical Engineering Saghbiny, E., Da Silva, J., Leblanc, L., Bobbio, C., Morel, G.G., Vialle, R. and Tamadazte, B., 2023, September. Breach detection in spine surgery based on cutting torque with ex-vivo experimental validation. In Conference on New Technologies for Computer and Robot Assisted Surgery.
Political Science Reuning, K., Whitesell, A. and Hannah, A.L., 2022. Facebook algorithm changes may have amplified local republican parties. Research & Politics, 9(2), p.20531680221103809.
Geography Lyu, R., Pang, J., Zhang, J. and Zhang, J., 2024. The impacts of disturbances on mountain ecosystem services: Insights from BEAST and Bayesian network. Applied Geography, 162, p.103143.
Watershed Hydrology Sakizadeh, M., Milewski, A. and Sattari, M.T., 2023. Analysis of Long-Term Trend of Stream Flow and Interaction Effect of Land Use and Land Cover on Water Yield by SWAT Model and Statistical Learning in Part of Urmia Lake Basin, Northwest of Iran. Water, 15(4), p.690.
Oceanography Oehlert, A.M., Hunter, H., Riopelle, C. and Purkis, S.J., 2023. Perturbation to North Atlantic Ocean‐Climate Dynamics Tripled Whitings Mud Production in the Bahamas. Journal of Geophysical Research: Oceans, 128(11), p.e2023JC020021.
Hydraulic Engineering Xu, X., Yang, J., Ma, C., Qu, X., Chen, J. and Cheng, L., 2022. Segmented modeling method of dam displacement based on BEAST time series decomposition. Measurement, 202, p.111811.
Social Media Barrie, C., Ketchley, N., Siegel, A. and Bagdouri, M., 2023. Measuring Media Freedom.
Political Economy Benchimol, J. and Palumbo, L., 2023. Sanctions and Russian Online Prices.
Physiology Shakeel, M., Brockmann, A. Temporal effects of sugar intake on fly local search and honey bee dance behaviour. J Comp Physiol A (2023). https://doi.org/10.1007/s00359-023-01670-6
Marine Sciences Haditiar, Y., Ikhwan, M., Mahdi, S., Siregar, A.N., Haridhi, H.A., Setiawan, I., Nanda, M., Prajaputra, V. and Irham, M., 2024. Oceanographic characteristics in the North of Aceh waters. Regional Studies in Marine Science, 71, p.103408.
Marine Sciences Stamieszkin, K., Millette, N.C., Luo, J.Y., Follett, E., Record, N.R. and Johns, D.G., 2024. Large protistan mixotrophs in the North Atlantic Continuous Plankton Recorder time series: associated environmental conditions and trends. Frontiers in Marine Science, 11, p.1320046.
Biogeochemmistry Dahl, M., Gullström, M., Bernabeu, I., Serrano, O., Leiva‐Dueñas, C., Linderholm, H.W., Asplund, M.E., Björk, M., Ou, T., Svensson, J.R. and Andrén, E., 2024. A 2,000‐year record of eelgrass (Zostera marina L.) colonization shows substantial gains in blue carbon storage and nutrient retention. Global Biogeochemical Cycles, 38(3), p.e2023GB008039.
Petroleum Engineering Pan, Y., Bi, R., Yang, S., Lyu, Z. and Ju, X., 2024, February. Application of a Bayesian Ensemble Algorithm for Automated Production Diagnostic of Gas Wells with Plunger-Lift. In International Petroleum Technology Conference (p. D011S029R008). IPTC.
Ichthyology Kaeding, L.R., 2023. Climate-change and nonnative-piscivore impacts on a renowned Oncorhynchus metapopulation, requirements for metapopulation recovery, and similarities to anadromous salmonid metapopulations. Aquatic Sciences, 85(4), p.88.
Remote Sensing Mulverhill, C., Coops, N.C. and Achim, A., 2023. Continuous monitoring and sub-annual change detection in high-latitude forests using Harmonized Landsat Sentinel-2 data. ISPRS Journal of Photogrammetry and Remote Sensing, 197, pp.309-319.
Physical Chemistry Faran, M. and Bisker, G., 2023. Nonequilibrium Self-Assembly Time Forecasting by the Stochastic Landscape Method. The Journal of Physical Chemistry B.
Analytical Chemistry Simic, M., Neuper, C., Hohenester, U. and Hill, C., 2023. Optofluidic force induction as a process analytical technology. Analytical and Bioanalytical Chemistry, pp.1-11.
Ecosystem Sciences Lyu, R., Zhao, W., Pang, J., Tian, X., Zhang, J. and Wang, N., 2022. Towards a sustainable nature reserve management: Using Bayesian network to quantify the threat of disturbance to ecosystem services. Ecosystem Services, 58, p.101483.
Environmental Sciences Nickerson, S., Chen, G., Fearnside, P., Allan, C.J., Hu, T., de Carvalho, L.M. and Zhao, K., 2022. Forest loss is significantly higher near clustered small dams than single large dams per megawatt of hydroelectricity installed in the Brazilian Amazon. Environmental Research Letters.
Geology Fan, X., Goeppert, N. and Goldscheider, N., 2023. Quantifying the historic and future response of karst spring discharge to climate variability and change at a snow-influenced temperate catchment in central Europe. Hydrogeology Journal, pp.1-17.
Wildlife Smith, Matthew M., and Jonathan N. Pauli. "Connectivity maintains genetic diversity and population persistence within an archipelagic refugia even under declining lake ice." Mechanisms of species recovery for a forest carnivore in a changing landscape: 173.
Climate Sciences Duke, N.C., Mackenzie, J.R., Canning, A.D., Hutley, L.B., Bourke, A.J., Kovacs, J.M., Cormier, R., Staben, G., Lymburner, L. and Ai, E., 2022. ENSO-driven extreme oscillations in mean sea level destabilise critical shoreline mangroves—An emerging threat. PLOS Climate, 1(8), p.e000003
Finance Candelaria, Christopher A., Shelby M. McNeill, and Kenneth A. Shores. (2022). What is a School Finance Reform? Uncovering the ubiquity and diversity of school finance reforms using a Bayesian changepoint estimator.(EdWorkingPaper: 22-587). Retrieved from Annenberg Institute at Brown University: https://doi.org/10.26300/4vey-3w10
Public health Linnell, K., Fudolig, M., Schwartz, A., Ricketts, T.H., O'Neil-Dunne, J.P., Dodds, P.S. and Danforth, C.M., 2022. Spatial changes in park visitation at the onset of the pandemic. arXiv preprint arXiv:2205.15937.
Biometerology Li, Y., Liu, Y., Bohrer, G., Cai, Y., Wilson, A., Hu, T., Wang, Z. and Zhao, K., 2022. Impacts of forest loss on local climate across the conterminous United States: Evidence from satellite time-series observations. Science of The Total Environment, 802, p.149651.
Applied Math Ferguson, Daniel, and Francois G. Meyer. Probability density estimation for sets of large graphs with respect to spectral information using stochastic block models. arXiv preprint arXiv:2207.02168 (2022).
Transportation Science Delavary, M., Kalantari, A.H., Mohammadzadeh Moghaddam, A., Fakoor, V., Lavalliere, M. and Wilhelm Siebert, F., 2023. Road traffic mortality in Iran: longitudinal trend and seasonal analysis, March 2011-February 2020. International Journal of Injury Control and Safety Promotion, pp.1-12.
Water quality He, Ziming, Jiayu Yao, Yancen Lu, and Danlu Guo. "Detecting and explaining long-term changes in river water quality in south eastern Australia." Hydrological Processes: e14741.
Air quality Wu, S., Yao, J., Wang, Y. and Zhao, W., 2023. Influencing factors of PM2. 5 concentrations in the typical urban agglomerations in China based on wavelet perspective. Environmental Research, p.116641.
Hydrology Zohaib, M. and Choi, M., 2020. Satellite-based global-scale irrigation water use and its contemporary trends. Science of The Total Environment, 714, p.136719.
Energy Engineering Lindig, S., Theristis, M. and Moser, D., 2022. Best practices for photovoltaic performance loss rate calculations. Progress in Energy, 4(2), p.022003.
Virology Shen, L., Sun, M., Song, S., Hu, Q., Wang, N., Ou, G., Guo, Z., Du, J., Shao, Z., Bai, Y. and Liu, K., 2022. The impact of anti-COVID19 nonpharmaceutical interventions on hand, foot, and mouth disease—A spatiotemporal perspective in Xi'an, northwestern China. Journal of medical virology.
Pharmaceutical Sciences Patzkowski, M.S., Costantino, R.C., Kane, T.M., Nghiem, V.T., Kroma, R.B. and Highland, K.B., 2022. Military Health System Opioid, Tramadol, and Gabapentinoid Prescription Volumes Before and After a Defense Health Agency Policy Release. Clinical Drug Investigation, pp.1-8.
Geography Cai, Y., Liu, S. and Lin, H., 2020. Monitoring the vegetation dynamics in the Dongting Lake Wetland from 2000 to 2019 using the BEAST algorithm based on dense Landsat time series. Applied Sciences, 10(12), p.4209.
Oceanography Pitarch, J., Bellacicco, M., Marullo, S. and Van Der Woerd, H.J., 2021. Global maps of Forel-Ule index, hue angle and Secchi disk depth derived from 21 years of monthly ESA Ocean Colour Climate Change Initiative data. Earth System Science Data, 13(2), pp.481-490.
Photovoltaics Micheli, L., Theristis, M., Livera, A., Stein, J.S., Georghiou, G.E., Muller, M., Almonacid, F. and Fernadez, E.F., 2021. Improved PV soiling extraction through the detection of cleanings and change points. IEEE Journal of Photovoltaics, 11(2), pp.519-526.
Climate Sciences White, J.H., Walsh, J.E. and Thoman Jr, R.L., 2021. Using Bayesian statistics to detect trends in Alaskan precipitation. International Journal of Climatology, 41(3), pp.2045-2059.
Field Hydrology Merk, M., Goeppert, N. and Goldscheider, N., 2021. Deep desiccation of soils observed by long-term high-resolution measurements on a large inclined lysimeter. Hydrology and Earth System Sciences, 25(6), pp.3519-3538.
Forest Ecology Moreno-Fernandez, D., Viana-Soto, A., Camarero, J.J., Zavala, M.A., Tijerin, J. and Garcia, M., 2021. Using spectral indices as early warning signals of forest dieback: The case of drought-prone Pinus pinaster forests. Science of The Total Environment, 793, p.148578.
Atmospheric Sciences Tingwei, C., Tingxuan, H., Bing, M., Fei, G., Yanfang, X., Rongjie, L., Yi, M. and Jie, Z., 2021. Spatiotemporal pattern of aerosol types over the Bohai and Yellow Seas observed by CALIOP. Infrared and Laser Engineering, 50(6), p.20211030.
Terrestrial ecology Dashti, H., Pandit, K., Glenn, N.F., Shinneman, D.J., Flerchinger, G.N., Hudak, A.T., de Graaf, M.A., Flores, A., Ustin, S., Ilangakoon, N. and Fellows, A.W., 2021. Performance of the ecosystem demography model (EDv2. 2) in simulating gross primary production capacity and activity in a dryland study area. Agricultural and Forest Meteorology, 297, p.108270.
Statistics Storath, M. and Weinmann, A., 2023. Smoothing splines for discontinuous signals. Journal of Computational and Graphical Statistics, (just-accepted), pp.1-26.
Environmental Engineering Bainbridge, R., Lim, M., Dunning, S., Winter, M.G., Diaz-Moreno, A., Martin, J., Torun, H., Sparkes, B., Khan, M.W. and Jin, N., 2022. Detection and forecasting of shallow landslides: lessons from a natural laboratory. Geomatics, Natural Hazards and Risk, 13(1), pp.686-704.
Hydrology Yang, X., Tian, S., You, W. and Jiang, Z., 2021. Reconstruction of continuous GRACE/GRACE-FO terrestrial water storage anomalies based on time series decomposition. Journal of Hydrology, 603, p.127018.
Landscape Ecology Adams, B.T., Matthews, S.N., Iverson, L.R., Prasad, A.M., Peters, M.P. and Zhao, K., 2021. Spring phenological variability promoted by topography and vegetation assembly processes in a temperate forest landscape. Agricultural and Forest Meteorology, 308, p.108578.

rbeast's People

Contributors

dirt avatar ebigelow avatar jj avatar kbodolai avatar zhaokg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbeast's Issues

Credible Interval for changepoints

Hi Zhaokg,

I am working with just one timeseries of 1 period and I am detecting correctly the changepoints and its change in trend. However, I would like to have some deeper insights and tools to see if actually a probability of (let's say 0.6) in a change point, is enough to consider it a valid changepoint.

I've been searching in all of the articles you shared but I cannot find an example on how to build a credible interval 95% in those cases. Do you have any example or some thought on how I could do it? Or how can I access to the simulations to build a CI?

Thank you so much, you package is amazing!

Cannot build on AArch64 Linux

While installing this package on a AArch64 Linux machine, I got the following error at link time:

* installing to library ‘/root/tmp/libdir’
* installing *source* package ‘Rbeast’ ...
** package ‘Rbeast’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)’
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c _beastv2_gui_plot.c -o _beastv2_gui_plot.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c _beastv2_gui_winmain.c -o _beastv2_gui_winmain.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_common.c -o abc_common.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_cpu.c -o abc_cpu.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_date.c -o abc_date.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_dir.c -o abc_dir.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ide_util_R.c -o abc_ide_util_R.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ide_util_common.c -o abc_ide_util_common.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ide_util_matlab.c -o abc_ide_util_matlab.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ide_util_python.c -o abc_ide_util_python.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ioFlush.c -o abc_ioFlush.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_lzw.c -o abc_lzw.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_mat.c -o abc_mat.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_math.c -o abc_math.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_math_avx.c -o abc_math_avx.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_math_avx512.c -o abc_math_avx512.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_mcmc.c -o abc_mcmc.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_mem.c -o abc_mem.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_mem_ext.c -o abc_mem_ext.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_pthread.c -o abc_pthread.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_rand_pcg_global.c -o abc_rand_pcg_global.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_rand_pcg_local.c -o abc_rand_pcg_local.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_rand_pcg_local_avx2.c -o abc_rand_pcg_local_avx2.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_rand_pcg_local_avx512.c -o abc_rand_pcg_local_avx512.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_rand_pcg_local_generic.c -o abc_rand_pcg_local_generic.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_sort.c -o abc_sort.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_svd.c -o abc_svd.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_system.c -o abc_system.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_timer.c -o abc_timer.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_tranpose.c -o abc_tranpose.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_ts_func.c -o abc_ts_func.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_vec.c -o abc_vec.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_vec_avx2.c -o abc_vec_avx2.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_vec_avx512.c -o abc_vec_avx512.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_vec_generic.c -o abc_vec_generic.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c abc_win32_demo.c -o abc_win32_demo.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_COREV4.c -o beastv2_COREV4.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_COREV4_bic.c -o beastv2_COREV4_bic.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_COREV4_bic_mthrd.c -o beastv2_COREV4_bic_mthrd.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_COREV4_gui.c -o beastv2_COREV4_gui.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_COREV4_mthrd.c -o beastv2_COREV4_mthrd.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_allocinitmem.c -o beastv2_basis_allocinitmem.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_computexy_q.c -o beastv2_basis_computexy_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_cvtKnotsToBinVec.c -o beastv2_basis_cvtKnotsToBinVec.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_genrandbasis.c -o beastv2_basis_genrandbasis.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_gensegment.c -o beastv2_basis_gensegment.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_pickcmptId.c -o beastv2_basis_pickcmptId.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_proposeNew_q.c -o beastv2_basis_proposeNew_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_updateKsKe_prec0123.c -o beastv2_basis_updateKsKe_prec0123.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_basis_updategoodvec.c -o beastv2_basis_updategoodvec.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_date.c -o beastv2_date.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_func_q.c -o beastv2_func_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_in_args.c -o beastv2_io_in_args.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_in_readts.c -o beastv2_io_in_readts.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_out_allocmem_q.c -o beastv2_io_out_allocmem_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_out_printargs.c -o beastv2_io_out_printargs.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_out_tsextractprint.c -o beastv2_io_out_tsextractprint.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_io_out_write_q.c -o beastv2_io_out_write_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_model_allocinit_q.c -o beastv2_model_allocinit_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_prior_model.c -o beastv2_prior_model.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_prior_precfunc.c -o beastv2_prior_precfunc.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_svdbasis.c -o beastv2_svdbasis.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c beastv2_xxyy_allocmem_q.c -o beastv2_xxyy_allocmem_q.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c globalvars.c -o globalvars.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c glue_code.c -o glue_code.o
gcc -I"/root/r/dist/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -I/usr/local/include '-D_FORTIFY_SOURCE=2'  -DR_RELEASE   -fPIC  -g -O2 -Wall -pedantic -fexceptions -fstack-protector-strong -fstack-clash-protection -Werror=implicit-function-declaration -Wstrict-prototypes   -c tetris.c -o tetris.o
gcc -shared -L/root/r/dist/lib -L/usr/local/lib -o Rbeast.so _beastv2_gui_plot.o _beastv2_gui_winmain.o abc_common.o abc_cpu.o abc_date.o abc_dir.o abc_ide_util_R.o abc_ide_util_common.o abc_ide_util_matlab.o abc_ide_util_python.o abc_ioFlush.o abc_lzw.o abc_mat.o abc_math.o abc_math_avx.o abc_math_avx512.o abc_mcmc.o abc_mem.o abc_mem_ext.o abc_pthread.o abc_rand_pcg_global.o abc_rand_pcg_local.o abc_rand_pcg_local_avx2.o abc_rand_pcg_local_avx512.o abc_rand_pcg_local_generic.o abc_sort.o abc_svd.o abc_system.o abc_timer.o abc_tranpose.o abc_ts_func.o abc_vec.o abc_vec_avx2.o abc_vec_avx512.o abc_vec_generic.o abc_win32_demo.o beastv2_COREV4.o beastv2_COREV4_bic.o beastv2_COREV4_bic_mthrd.o beastv2_COREV4_gui.o beastv2_COREV4_mthrd.o beastv2_basis_allocinitmem.o beastv2_basis_computexy_q.o beastv2_basis_cvtKnotsToBinVec.o beastv2_basis_genrandbasis.o beastv2_basis_gensegment.o beastv2_basis_pickcmptId.o beastv2_basis_proposeNew_q.o beastv2_basis_updateKsKe_prec0123.o beastv2_basis_updategoodvec.o beastv2_date.o beastv2_func_q.o beastv2_io_in_args.o beastv2_io_in_readts.o beastv2_io_out_allocmem_q.o beastv2_io_out_printargs.o beastv2_io_out_tsextractprint.o beastv2_io_out_write_q.o beastv2_model_allocinit_q.o beastv2_prior_model.o beastv2_prior_precfunc.o beastv2_svdbasis.o beastv2_xxyy_allocmem_q.o globalvars.o glue_code.o tetris.o -lpthread -lm -L/root/r/dist/lib -lR
installing to /root/tmp/libdir/00LOCK-Rbeast/00new/Rbeast/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘Rbeast’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object ‘/root/tmp/libdir/00LOCK-Rbeast/00new/Rbeast/libs/Rbeast.so’:
  /root/tmp/libdir/00LOCK-Rbeast/00new/Rbeast/libs/Rbeast.so: undefined symbol: __builtin_readcyclecounter
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/root/tmp/libdir/Rbeast’

What happened was that the following function uses the compiler built-in __builtin_readcyclecounter:
https://github.com/zhaokg/Rbeast/blob/master/R/src/abc_timer.h#L101
__builtin_readcyclecounter is not implemented in GCC when targeting AArch64, but Clang does so M1 Mac linked OK.

I propose we handle the cpu_ARM64 case following the patch to a similar issue that resolved it for MariaDB: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=216668&action=diff

Essentially they check if the built-in exists and if not fallback to inline ASM, and since we know it's AArch64, it should be relatively safe.
I'm happy to open a PR to fix this.

Writing BEAST output to disk not working

I tried to write the BEAST output to disk using:
option$outputToDisk=1
option$outputFolder='C:/folder'
But when the optional parameters were printed on starting BEAST the output folder had changed to "outputFolder=Ñ0zl"
"Writing output..." was printed on the console but no files were written in the specified output folder. I searched for a temporary folder named Ñ0zl, but found nowhere that BEAST was writing the output to.
My friend and I tried using different folders, but instead both got "outputFolder=aKzl" on different data.
I tried to look at the scripts underlying beast, but couldn't figure out where the error was.

It would also be good to know where the outputs "marg_lik" and "sig2" have come from and what they mean, as this isn't outlined in the Rbeast package guidance.

abc_cpu lacks support for PowerPC

/opt/local/bin/gcc-mp-12 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -isystem/opt/local/include/LegacySupport -I/opt/local/include  -DR_RELEASE   -fPIC  -pipe -Os -arch ppc  -c abc_cpu.c -o abc_cpu.o
abc_cpu.c:102:5: error: #error "No cpuid intrinsic defined for processor architecture."
  102 | #   error "No cpuid intrinsic defined for processor architecture."
      |     ^~~~~
abc_cpu.c: In function 'detect_OS_AVX':
abc_cpu.c:115:40: error: '_XCR_XFEATURE_ENABLED_MASK' undeclared (first use in this function)
  115 |         uint64_t xcrFeatureMask=xgetbv(_XCR_XFEATURE_ENABLED_MASK);
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
abc_cpu.c:115:40: note: each undeclared identifier is reported only once for each function it appears in
abc_cpu.c: In function 'detect_OS_AVX512':
abc_cpu.c:123:36: error: '_XCR_XFEATURE_ENABLED_MASK' undeclared (first use in this function)
  123 |     uint64_t xcrFeatureMask=xgetbv(_XCR_XFEATURE_ENABLED_MASK);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [abc_cpu.o] Error 1

besat_123_example.txt runing wrong

Hi, Mr,zhao. When I run the code
'Update beast123_raster_example.txt' in R , the line 11 which is 'ndvi3d = stack(filelist)', it's always report a error'Error in data.frame(values = unlist(unname(x)), ind, stringsAsFactors = FALSE) : Parameter values mean different number of rows: 437, 0''
Would you like to Work out this error? I do not know if it my operation error or something else.
Waiting for your reply.

ERROR: r1 < r2; this should never happen and there must be something wrong!

I try to find the best fitted model , so i use grid search based on diffrent scp_max and tcp_max combination.
when I set parameters like :o=rb.beast(ndvi_values[:],tcp_minmax=(0,tcp_max),scp_minmax=(0,scp_max),quiet=True, mcmc_seed=42) ,it works well.
But when i set parameters like :o=rb.beast(ndvi_values[:],tcp_minmax=(tcp_max,tcp_max),scp_minmax=(scp_max,scp_max),quiet=True, mcmc_seed=42), one of my time series will throw error r1<r2 during the circulate.

作者您好,我想请问一下这个问题为什么出现。我希望通过参数搜索找到rmse最低的拟合函数,然后我尝试了两种设置变点数量的方法。版本1是设置范围,版本2则直接制定变点数。也许是我搜索的范围过大而时间序列不够长吗?我在版本2的循环中获得了报错。

Issue on marginal likelihood

The manual says:

the average of the model marginal likelihood; the larger marg_lik, the
better the fitting for a given time series.

Would that be the negative larger? Foir instance, -1000 would be better than -10, right?

Beast with Octave 8.2

Hello, I would like to try your software with Windows 11 x64 + Octave 8.2, it doesn't work, does it need to be recompiled ? Can you make a script for recompilation ?

thanks

Mario Rossi

calculations are incomplete in beast123 when using large array as input

I found that beast123 can't calculate compeletly when the input array is big enough(number of row or column is bigger than 200)

`import numpy as np
import Rbeast as rb
import xarray as xr
import matplotlib.pyplot as plt

ndvi3d = np.load("sub_r_ndvi.npz")['r_nvdi'] # (722, 1378, 38) array

metadata = lambda: None
metadata.start = 1986
metadata.season = 'none'
metadata.whichDimIsTime = 3
metadata.period = 1.0
extra = rb.args()
extra.numThreadsPerCPU = 2
o = rb.beast123(ndvi3d, metadata, [], [], extra)
plt.imshow(o.trend.cp[:, :, 0])
plt.show()`

the abolve code shows a plot like

11820

however when we decrease the number of row and column
ndvi3d = ndvi3d[0:150, 0:150, :]
the calculation can be completely like
8140

Segmemntation fault(Core dumped) error for samples sized over 1000k

The Python version of the package (also the R) works fine with smaller sample sizes till 10k and even for some 100k values, but as I keep on increasing the sample size, the above mentioned error becomes more and more prominent to a point, the code doesn't execute at all.

Mutiple periods?

Can the Rbeast explicitly handle the case that a time series with mutiple periods?

Error setting MaxKnotNum_Trend to zero

I would like to set MaxKnotNum_Trend to zero to examine seasonal changes only. When I do this I get the error "r2<r1:There must be something wrong!" before RStudio crashes.

Dos it support online mode?

This is great work. I know the origional paper from Adam and MacKay talking about online changepoint. Does it support online calculation? thanks.

beast123 + MATLAB crashing ... Linux

Ubuntu Linux 22.04 LTS + MATLAB R2023a upd3

>> rbeast_version

rbeastGitHubVersion =

    0.9461

Example:

      load('imageStack.mat') 
       % A toy example of stacked time series images: unevely-spaced in time
      NDVI3D=imageStack.ndvi    % a 12x9x1066 3D cube
      TIME  =imageStack.datestr % 1066 is the time series length%
      metadata=[];      
      metadata.time=[];
      metadata.time.dateStr=TIME
      metadata.time.strFmt='LT05_018032_20110726.yyyy-mm-dd';
      metadata.deltaTime  =1/12; % aggregated at a monthly interval
      metadata.period     =1.0;  % the period is 1.0 (year)
      extra=[];
      extra.dumpInputData   =true % get a copy of the aggregated input
      extra.numThreadsPerCPU = 2; % 2 threads per CPU core
      o=beast123(NDVI3D,metadata,[],[], extra) 
      imagesc(o.sig2)
      imagesc(o.trend.ncpPr(:,:,1:3))
      printbeast(o,[2,4]) %print the result at row 2 and col 4     
      plotbeast(o,'index',[2,4]) %plot the result at row 2 and col 4  

produce always MATLAB Crash:

MATLAB Log File: /home/kva/matlab_crash_dump.1020259-1


MATLAB Log File


      Segmentation violation detected at 2023-07-10 15:34:47 +0200

Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : X-Cinnamon
GNU C Library : 2.35 stable
Graphics Driver : Uninitialized hardware
Graphics card 1 : 0x10de ( 0x10de ) 0x1cb1 Version 535.54.3.0 (0-0-0)
Graphics card 2 : Not Started 0x8086 ( 0x8086 ) 0x3e98 Version 0.0.0.0 (0-0-0)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 6257193
MATLAB Root : /opt/MATLAB/R2023a
MATLAB Version : 9.14.0.2286388 (R2023a) Update 3
OpenGL : hardware
Operating System : Linux Mint 21.1
Process ID : 1020259
Processor ID : x86 Family 6 Model 158 Stepping 13, GenuineIntel
Session Key : d5cc3121-ac3a-4dd2-bc38-dce0840e29fb
Window System : The X.Org Foundation (12101004), display :0

Fault Count: 1

Abnormal termination:
Segmentation violation

Current Thread: 'MCR 0 interpret' id 140544990295616

Register State (from fault):
RAX = 0000000000000000 RBX = 00007fd363c62c90
RCX = 0000000000000000 RDX = 0000000000000000
RSP = 00007fd32e3870a0 RBP = 00007fd32e387680
RSI = 00007fd32e3871e0 RDI = 00007fd0be3f4640

R8 = 0000000000000001 R9 = 00007fd1e0823000
R10 = 00007fd1f8c6ca00 R11 = 4272b9ef08d57889
R12 = 0000000000000010 R13 = 00007fd363e6cc80
R14 = 000000000000001f R15 = 00007fd32e3871e0

RIP = 00007fd36c89659b EFL = 0000000000010202

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007fd36c89659b /lib/x86_64-linux-gnu/libc.so.6+00615835
[ 1] 0x00007fd363c5a8be /home/kva/tmp/BEAST/work/Rbeast.mexa64+00370878
[ 2] 0x00007fd363c5ae2e /home/kva/tmp/BEAST/work/Rbeast.mexa64+00372270 mexFunction+00000014
[ 3] 0x00007fd3623d8f5f /opt/MATLAB/R2023a/bin/glnxa64/libmex.so+00954207
[ 4] 0x00007fd3623d8fd7 /opt/MATLAB/R2023a/bin/glnxa64/libmex.so+00954327
[ 5] 0x00007fd3623d9047 /opt/MATLAB/R2023a/bin/glnxa64/libmex.so+00954439
[ 6] 0x00007fd3623da5fa /opt/MATLAB/R2023a/bin/glnxa64/libmex.so+00959994
[ 7] 0x00007fd3623c51b0 /opt/MATLAB/R2023a/bin/glnxa64/libmex.so+00872880
[ 8] 0x00007fd362bf13dd /opt/MATLAB/R2023a/bin/glnxa64/libmwm_dispatcher.so+01528797 ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00000173
[ 9] 0x00007fd362bf24cc /opt/MATLAB/R2023a/bin/glnxa64/libmwm_dispatcher.so+01533132
[ 10] 0x00007fd362bf28a1 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_dispatcher.so+01534113 ZN8Mfh_file8dispatchEiPSt10unique_ptrI11mxArray_tagN6matrix6detail17mxDestroy_deleterEEiPPS1+00000033
[ 11] 0x00007fd361e5d95e /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+02480478
[ 12] 0x00007fd361e5dba6 /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+02481062
[ 13] 0x00007fd35100ed04 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+10546436
[ 14] 0x00007fd3510018e0 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+10492128
[ 15] 0x00007fd350f9d692 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+10081938
[ 16] 0x00007fd350ced250 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07262800
[ 17] 0x00007fd350cef544 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07271748
[ 18] 0x00007fd350ceca89 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07260809
[ 19] 0x00007fd350cfe3ff /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07332863
[ 20] 0x00007fd350cfee79 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07335545
[ 21] 0x00007fd350cec8a4 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07260324
[ 22] 0x00007fd350cec996 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+07260566
[ 23] 0x00007fd350e2961c /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+08558108
[ 24] 0x00007fd350e2d6b1 /opt/MATLAB/R2023a/bin/glnxa64/libmwm_lxe.so+08574641
[ 25] 0x00007fd361fdb1c8 /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+04043208
[ 26] 0x00007fd361ebd4ef /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+02872559
[ 27] 0x00007fd361ec4567 /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+02901351
[ 28] 0x00007fd361f826d5 /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+03679957
[ 29] 0x00007fd361f82b3e /opt/MATLAB/R2023a/bin/glnxa64/libmwlxemainservices.so+03681086
[ 30] 0x00007fd362ed7d12 /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+01019154 _ZN3iqm14UserEvalPlugin7executeEP15inWorkSpace_tag+00000754
[ 31] 0x00007fd26a474f4c /opt/MATLAB/R2023a/bin/glnxa64/libnativejmi.so+01011532 _ZN9nativejmi17JmiUserEvalPlugin7executeEP15inWorkSpace_tag+00000028
[ 32] 0x00007fd362eb1bd0 /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00863184
[ 33] 0x00007fd362e7d64b /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00648779
[ 34] 0x00007fd3624ad831 /opt/MATLAB/R2023a/bin/glnxa64/libmwbridge.so+00497713
[ 35] 0x00007fd3624adc43 /opt/MATLAB/R2023a/bin/glnxa64/libmwbridge.so+00498755
[ 36] 0x00007fd3624c90c2 /opt/MATLAB/R2023a/bin/glnxa64/libmwbridge.so+00610498 _Z22mnGetCommandLineBufferbRbN7mwboost8optionalIKP15inWorkSpace_tagEEbRKNS0_9function2IN6mlutil14cmddistributor17inExecutionStatusERKNSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEES4_EE+00000210
[ 37] 0x00007fd3624c9303 /opt/MATLAB/R2023a/bin/glnxa64/libmwbridge.so+00611075 _Z8mnParserv+00000435
[ 38] 0x00007fd362d4d1bf /opt/MATLAB/R2023a/bin/glnxa64/libmwmcr.so+00889279
[ 39] 0x00007fd36d935234 /opt/MATLAB/R2023a/bin/glnxa64/libmwmvm.so+03363380 ZN14cmddistributor15PackagedTaskIIP10invokeFuncIN7mwboost8functionIFvvEEEEENS2_10shared_ptrINS2_6futureIDTclfp_EEEEEERKT+00000068
[ 40] 0x00007fd36d9354e9 /opt/MATLAB/R2023a/bin/glnxa64/libmwmvm.so+03364073 _ZNSt17_Function_handlerIFN7mwboost3anyEvEZN14cmddistributor15PackagedTaskIIP10createFuncINS0_8functionIFvvEEEEESt8functionIS2_ET_EUlvE_E9_M_invokeERKSt9_Any_data+00000025
[ 41] 0x00007fd362ed1d8d /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00994701 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tag+00000093
[ 42] 0x00007fd362d48765 /opt/MATLAB/R2023a/bin/glnxa64/libmwmcr.so+00870245
[ 43] 0x00007fd362eb1bd0 /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00863184
[ 44] 0x00007fd362e7bab2 /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00641714
[ 45] 0x00007fd362e7c403 /opt/MATLAB/R2023a/bin/glnxa64/libmwiqm.so+00644099
[ 46] 0x00007fd362d37d9e /opt/MATLAB/R2023a/bin/glnxa64/libmwmcr.so+00802206
[ 47] 0x00007fd362d37995 /opt/MATLAB/R2023a/bin/glnxa64/libmwmcr.so+00801173
[ 48] 0x00007fd362d37bed /opt/MATLAB/R2023a/bin/glnxa64/libmwmcr.so+00801773
[ 49] 0x00007fd36cee0277 /opt/MATLAB/R2023a/bin/glnxa64/libmwboost_thread.so.1.78.0+00045687
[ 50] 0x00007fd36c894b43 /lib/x86_64-linux-gnu/libc.so.6+00609091
[ 51] 0x00007fd36c926a00 /lib/x86_64-linux-gnu/libc.so.6+01206784

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

latest MATLAB version with beast123 produce error

Example regarding "beast123.m" (Ubuntu 22.04 Linux, Matlab R2023a upd3):

load('Nile')   % Nile river annual streamflow: trend-only data
metadata=[];
metadata.season     = 'none'  % trend-only
metadata.startTime = 1871;
metadata.deltaTime = 1;
% Default values will be used if parameters are missing
o=beast123(Nile,metadata) 
printbeast(o)
plotbeast(o)

produce the following error message:

Error using plot
Vectors must be the same length.
Error in plotbeast>plot_order (line 622)
plot(h, t,   Order,  'color',clr );
Error in plotbeast (line 260)
plot_order(h,ytitle, has, clr,x, t, t2t,Order, ncp, cp);

Error while updating the package

On Windows 10 laptop I tried to update terra to it's latest varsion (v 0.9.9) but I am getting this error:

C:\Users\GEOGRA~1\AppData\Local\Temp\ccLwEwDN.s: Assembler messages:
C:\Users\GEOGRA~1\AppData\Local\Temp\ccLwEwDN.s:13: Error: unsupported instruction `movq'
C:\Users\GEOGRA~1\AppData\Local\Temp\ccLwEwDN.s:393: Error: unsupported instruction `movq'
make: *** [C:/PROGRA~1/R/R-41~1.1/etc/i386/Makeconf:238: abc_pthread.o] Error 1
ERROR: compilation failed for package 'Rbeast'
* removing 'C:/Program Files/R/R-4.1.1/library/Rbeast'
* restoring previous 'C:/Program Files/R/R-4.1.1/library/Rbeast'
Warning in install.packages :
  installation of package ‘Rbeast’ had non-zero exit status

I tried updating the package through RStudio.
Currently, I am having the v 0.9.7 installed. I am using RStudio Version 1.4.1717 and R v 4.1.1. Any ideas why this error?
The RTools is properly installed on my machine. Ican test this by:

Sys.which('make')
                              make 
"C:\\rtools40\\usr\\bin\\make.exe" 

Here is the output of the sessionInfo():

R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.1 cli_3.6.1      tools_4.1.1 

AttributeError

i reproduce the first example in Spyder then, i replace it with my own data, and it worked but, want to change to another personal data, i restarted the kernel and everything because appears the next error :
'Traceback (most recent call last):

File ~\AppData\Local\anaconda3\envs\rbeast\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\users\marciba\documents\python scripts\rbeast.py:8
import Rbeast as rb

File ~\Documents\Python Scripts\Rbeast.py:21
o = rb.beast(nile, season='none')

AttributeError: partially initialized module 'Rbeast' has no attribute 'beast' (most likely due to a circular import)'
and i have uninstalled Rbeast and reinstall and still don't work, can you help me?

here is the code:
import Rbeast as rb

import pandas as pd
import numpy as np

path_base = r"C:\Users\Marciba\Documents\Python Scripts"

data = pd.read_csv(path_base + '\ACfiltered.csv',sep=",")
col= ['index','newindex','Event Date','C2H2_Acetylene']
data.columns=col
#data['Event Date'] = pd.to_datetime(data['Event Date'],format="%Y-%m-%d %H:%M:%S")
nile = np.array(data['C2H2_Acetylene'])
year = np.array(data['Event Date'])
#nile, year = rb.load_example('nile')
o = rb.beast(nile, season='none')
rb.plot(o, title= 'Annual streamflow of the nile river')
rb.print(o)

Segments

Hello,
I was wondering if it is possible to obtain the segments of the Trend components given the break points?

RBeast issue -Assuming a complexity prior distribution on the number of change-points with `gammaParameter = 2`

Hi,

It seems that there is an issue with Rbeast, it is not running today. My code worked perfectly fine the previous day but today I am getting an error . (see the error output below "=====")

Assuming a complexity prior distribution on the number of change-points with gammaParameter = 2.
Computing posterior parameters... Error in numeric(nTime) : invalid 'length' argument
Is this a temporally thing? Can you help?

Thank you,

Returning MCMC samples of trend/seasonality functions

Hi!

Is it possible to access the posterior samples of the trend and/or seasonality functions directly? Specifically, I'm interested in accessing the sampled vectors that ultimately get averaged together to form the Y outputs. If not, could this feature be added?

These would be helpful in order to look at posterior inferences for things like locations of positive slope, which Rbeast already provides, but also things like the locations of the local minima/maxima and the presence of particular shapes. Rather than open separate issues for each new inference that might come up, all would be handled if the user is given an option where those posterior samples could be returned directly, probably in the form of a matrix that is size N by n_iterations (assuming vector time-series input).

I recognize that returning posterior samples for ALL parameters is probably not feasible, but hopefully the trend/seasonality vector samples are easy enough structurally to add as an extra return item.

Thank you!

Windows fatal exception: access violation - for a large number of points

Hello and thank you for this great package.
I am using Rbeast 0.1.16 in python 3.9.12 and i 've noticed that when i use the code below i get : Windows fatal exception: access violation in windows 10, and Progress: 0.0% done[>*************************************************************][1] 1706831 segmentation fault (core dumped) in linux.
I 've also noticed that this is happening when the length of the series is approximately over 5300 points. With lesser points it works properly.
Here is the code :

import Rbeast as rb
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
 

#---------------------------------Data Generation-------------------------------#
def generate_dataset_with_noise(num_breakpoints, noise_level):
    data = []
    for i in range(num_breakpoints):
        if i == 0:
            segment_length = np.random.randint(5, 1000)
        else:
            segment_length = np.random.randint(3, 800)
        value = np.random.randint(1, 10)
      
        segment = np.full(segment_length, value)
        # Generate noise with the same length as the segment
        noise = np.random.normal(0, noise_level, segment_length)
 
        # Add the noise to the segment values
        segment_with_noise = segment + noise
        data.extend(segment_with_noise)
    return data

# Specify the number of breakpoints and noise level
num_breakpoints =17
noise_level =0.3

# Generate a dataset with noise added to the integer values
data = generate_dataset_with_noise(num_breakpoints, noise_level)
df=pd.Series(data)

#--------Rbeast--------------------#

o = rb.beast(df, \
          start          = 1,
          deltat         = 1,
          season         = 'none',  # 'harmonic','dummy','svd','none'
          period         = float('nan'),
          scp_minmax     = [0, 10],
          sorder_minmax  = [0, 5],
          sseg_minlength = None,  # an integer
          tcp_minmax     = [0, 10],                                        
          torder_minmax  = [0, 1],
          tseg_minlength = None,  # an integer
          detrend        = False,
          deseasonalize  = False,
          mcmc_seed      = 0,
          mcmc_burbin    = 200,
          mcmc_chains    = 3,
          mcmc_thin      = 5,
          mcmc_samples   = 5000,                                                 
          precValue      = 1.5,
          precPriorType  = 'componentwise',  # componentwise','uniform','constant','orderwise'
          print_options  = True,
          print_progress = True,
          quiet          = False,
          hasOutlier     = False,
          ocp_max        = 10,
          gui            = False) 

Convergence of the results.

It is known that in a system based on Monte Carlo sampling, the results depend on the initial random seed. To my understanding, the RBeast package has this characteristic. However, the results are varying significantly, even when increasing the number of samples to 32,000, for example. I would greatly appreciate your help in finding a way to adjust the parameters so that the results converge. I am running the program on a computer with an i7 processor, 8GB of memory, and the Linux Ubuntu 22.04 operating system, using Python or Matlab environments. I am applying RBeast to remove the seasonality from weekly time series. This series has 978 observations, and I used the following parameters: beast(series, start=2005.01644, deltat=1/52, period=1, mcmc_samples=32000). Thank you for your attention

About Python drawing

Dear:
I am using Python language and when drawing using the Rbeat library, I found when I use "rb.plot(o)" the image is not displayed. May I ask how to make the image display?

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.