Jonas Lindeløv
  • Member for 9 years, 1 month
  • Last seen this week
Mixed effects model for power function data
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
Standard deviation of several measurements with uncertainties
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
How to do “broken stick linear regression” in R?
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
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
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
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
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
Change Point Analysis for Environmental Data
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
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
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 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 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
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
Finding the change point before a significant increase
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
How to characterize abrupt change?
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
Bayesian change point detection
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
Difference between MA and AR
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
Can I use multiple regression on a ranked response variable as a significance test for multiple covariates?
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
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
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
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
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
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
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
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 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
Finding the change point in data from a piecewise linear function
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