Jonas Lindeløv
  • Member for 9 years, 1 month
  • Last seen more than a week ago
Structural break time series
1 votes

ARMA/ARCH/GARCH parameter estimates are biased by The magnitude if the change point jumps. Larger jumps will lead to lower estimated AR. The proportion of change points relative to the number of ...

View answer
Interpolating data during structural breaks?
1 votes

If the structural break only affect a subset of the model parameters, you could use the whole time series to model all other parameters (carrying over info) and only use post-break info to infer the ...

View answer
Regression stats question
0 votes

Here's a solution using the R package mcp. Say we simplify your problem as a plateau followed by an abrupt change to a negative slope, followed by a plateau. Let's simulate some data: data = data....

View answer
Choosing a changepoint detection algorithm
Accepted answer
1 votes

The R package bcp seem to fulfill all of these (associated paper here). It returns the probability of change point at each index in your data, so you have to set a threshold yourself. This is a nice ...

View answer
Comparing differences in frequencies
2 votes

Given that the samples are independent, I would Infer the posterior of the binomial rate in each sample, e.g., $p_A n_A \sim Binomial(n_A, p_A)$. Compute the posterior distribution for ($\delta_{AB} =...

View answer
Including knowledge about structural breaks in forecast
1 votes

The Bayesian framework is apt for including prior information and giving you prediction intervals. The mcp package can model AR(N) time series and the docs has a section on forecasting with future ...

View answer
XmR charts for several measures at the same day/month
Accepted answer
1 votes

Classical statistical process control (SPC) operates only operates on a single sequence of data points (ranked time) without taking into account their temporal distance. That is, it does not matter ...

View answer
Model building with 10-fold validation
Accepted answer
2 votes

It makes a difference whether you want to maximize the predictive accuracy of future data or infer parameters from at-hand data. Predicting future data If your goal is out-of-sample prediction, then ...

View answer
How do I calculate prediction intervals for random forest predictions?
0 votes

The ranger package supports quantile predictions and hence prediction intervals: predict(ranger_fit, type = "quantile", quantiles = c(0.025, 0.975)).

View answer
Optimal bandwidth for discontinuity regression with Bernoulli
0 votes

There are many R packages that can do bernoulli/binomial discontinuity regression out of the box (they are identical for binary outcomes). See an overview here. The R package mcp with mcp(model, data, ...

View answer
Markov Switching Model with Markov trend
0 votes

This ressource lists most of the R packages available for change point analyses. A good handful of them can model AR(N) models which is a Markov process. In the AR(N) literature the term "non-...

View answer
Nonparametric changepoint detection for series with variable number of measurements across time
Accepted answer
3 votes

If you are open to using R, here is a solution using mcp. mcp can infer the location of changes in means (worked examples), variances (worked example), autocorrelation (worked example), and any ...

View answer
Clipped univariate OLS regression
1 votes

If you're open to using R, this would be the mcp model: model = list( y ~ 1, # b ~ 0 + m, # b + add slope ~ 0 # flat line from here ) fit = mcp(model, data) mcp will estimate the common ...

View answer
How do you fix one slope coefficient in an interaction term?
3 votes

If you want a probabilistic inference on the location of $k$ (the change point), mcp is well suited for cases like this. It infers the parameters of change point models using Bayesian Inference (see ...

View answer
Select model in piecewise regression
Accepted answer
1 votes

Bayesian inference is as coherent way to include prior knowledge. To my knowledge, only the mcp package allows for setting priors on change points. There are several approaches to your model ...

View answer
Simple algorithm to detect change point in time series
0 votes

If your data is distributed in a well-defined way, Westgard rules are probably the simplest solution. For your problem, I'd propose something like this: Compute some lower bound on "good" periods in ...

View answer
Use of Dyanmic Linear Models in Interrupted Time Series
0 votes

There are many R packages that can fit ARIMA models to break-point data. I compiled an overview of some of them here: https://lindeloev.github.io/mcp/articles/packages.html. Fewer of these can do a ...

View answer
How to statistically test relationship between two variables?
0 votes

Change points can be difficult in a frequentist framework. Most methods involve identifying the change point as a fixed location, ignoring the uncertainty inherent in estimating it. In addition, ...

View answer
How to define limits of breakpoint (max and min possible values) in a linear model (R segmented package)?
Accepted answer
2 votes

You have prior knowledge that the breakpoint can only occur at values between 5 and 20. Therefore, Bayesian modeling is well suited to this task. One further advantage of going Bayesian is that you ...

View answer
Is there a module in R to find structural breaks in time series data?
2 votes

There are a lot of R packages. Here is a non-exhaustive overview with worked examples. Below, I'll show a solution using the mcp package. Let's start by simulating some data that look a bit like ...

View answer
How to detect a drop in regularity / increase in spontaneity of time data?
0 votes

It seems that you are really modeling intervals between events. From your description it sounds like the trends do not follow smooth periods (Fourier) or autoregressive patterns. So the model could be:...

View answer
How to do a discontinuos segmented logistic regression in R?
2 votes

Here is a solution using the mcp package. You specify the regression model on a segment-by-segment basis. Model Let's say that the segments all have an intercept and a slope. Also, for the sake of ...

View answer
Error bars in a population and subtracting two populations with different error bars
Accepted answer
3 votes

If I read your question correctly, you want to infer the distances between the plateau heights and the associated uncertainty of this inference. If it makes sense to think of this as a change point ...

View answer
Unknown change point mixture model in JAGS
0 votes

The R package mcp uses JAGS to do do regression with change points, and it includes the option do have per-subject change points. Read more in the article on varying change points in mcp. See my ...

View answer
Temporal analysis of variation in random effects
3 votes

Some more information is needed to figure out the best solution here, so I'm simply answering a number of scenarios with example R code. Modeling the outcome If the outcome is binary, use family = ...

View answer
Detecting change point in a time series
Accepted answer
1 votes

You can do this with mcp. First, let's get your data in an accessible format. The variable "days" is the number of days since the first record. I remove the NAs: library(dplyr) D = read.table("...

View answer
Piecewise linear regression with knots as parameters
1 votes

I made the R package mcp exactly because there is a lack of packages quantifying the uncertainty (e.g., SE) about the inferred change point locations. Change point problems are conceptually simple in ...

View answer
Position of knots in piecewise linear regression as 'random effects'
Accepted answer
2 votes

You can do this in the R package mcp. Although your actual full model may be outside the scope of mcp, this is a way to do "random effects" change points. The mcp package contains a demo dataset ...

View answer
Piecewise linear with constraints with the segmented function on R
1 votes

The R package mcp was made exactly for these informed by-segment scenarios. Putting your data in a data.frame, you can do this: model = list( y ~ 1, # Intercept (plateau) ~ 0 + x, # Joined ...

View answer
Can I partition the only independent variable in the regression into two groups and compare the slopes between the partitioned groups?
0 votes

Using the data linked to in the comments, you can do this in the R package mcp: Define a model with two linear segments: model = list( y ~ 1 + x, ~ 1 + x ) Now sample it (setting adapt high to ...

View answer