Jonas Lindeløv
• Member for 9 years, 1 month
• Last seen this week
• Denmark

## 47 Answers

Accepted answer
8 votes

(Disclaimer: answering my own question after fiddling around - I'm really not an expert on this so please read critically) Step 1: create a power function, including the intercept, using the deriv ...

View answer
6 votes

This should be easily solved using bayesian inference. You know the measurement properties of the individual points with respect to their true value and want to infer the population mean and SD that ...

View answer
5 votes

The package mcp was made just for scenarios like this. See below how I structured your data as df later. Fit a change point model First, let's define a slope followed by a joined plateau. We add ...

View answer
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
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
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
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
2 votes

The mcp package has a website with extensive applied examples for many scenarios, including Poisson and Binomial models, which could be good for fish counts. Disclosure: I am the developer of mcp.

View answer
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 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 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 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 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 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 2 votes Use mcp if you (1) want to quantify uncertainty about the location of the change point, and (2) want to specify a more informed model structure, e.g., that the first segment is a plateau. I arranged ... View answer 2 votes This inference problem has many names, including change points, switch points, break points, broken line regression, broken stick regression, bilinear regression, piecewise linear regression, local ... View answer Accepted answer 2 votes Briefly, the package mcp does Bayesian change point regression. As of v0.2, it takes Gaussian, Binomial, Bernoulli, and Poisson. Modeling your data as four intercept-only segments: model = list( y ~... View answer Accepted answer 2 votes A key difference which I failed to appreciate: the MA model predictions of$x_t$include$\epsilon_{t-1}$in its computation whereas the AR model only predicts based on$x_{t-1}\$ without (explicit) ...

View answer
2 votes

Kruskal-Wallis takes N > 2 independent samples. With two groups, it reduces to the Mann-Whitney U. So the blog is accurate enough. To my knowledge, there is no analytical non-parametric solution when ...

View answer
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
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
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
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
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
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
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
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
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
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
Accepted answer
1 votes

The mcp package can do this. Say your data is First, let's simulate some data: df = data.frame(x = 1:100, y = c(rnorm(40, 10 + (1:40)*0.5), rnorm(60, 10 + 40*0....

View answer