Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:05:58+00:00 2026-06-15T15:05:58+00:00

Here is my data: data1 <- c(726, 718, 699, 737, 743, 734, 726, 722,

  • 0

Here is my data:

data1 <- c(726, 718, 699, 737, 743, 734, 726, 722, 715, 714, 752, 750, 
749, 746, 743, 734, 725, 717, 717, 708, 756, 753, 752, 746, 744, 
740, 737, 732, 728, 728, 720, 720, 714, 703, 702, 697, 758, 753, 
753, 746, 743, 734, 720, 706, 697, 761, 744, 749, 741, 738, 738, 
732, 725, 720, 712, 782, 778, 776, 773, 772, 770, 770, 769, 769, 
766, 763, 763, 756, 755, 753, 750, 749, 746, 737, 723, 711, 702, 
685, 782, 779, 778, 778, 776, 776, 775, 772, 770, 770, 766, 763, 
761, 756, 752, 738, 735, 729, 715)

This gives the plot using plot(data1) as:

enter image description here

How can I segregate the eight separate trends using R? I can use identify(data1) and mark them (the shifts) manually and use the indexes to segregate them but it would not be possible in my case since I am dealing with many of these kinds of plots. I want to extract the separate lines programmatically. Please let me know if there is statistical technique (time series and so on) which identifies the change in trends and tags and returns the eight series.

EDIT

I should make it clear that the number of series in the whole data-set need to be identified. The number of series in the sample data happens to be eight. But I will not know this in each case unless I plot the data and identify the breaks manually.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:05:59+00:00Added an answer on June 15, 2026 at 3:05 pm

    I think Kiril is right on here ( +1 ). This is a substantial area of research/knowledge, sometimes called Change Point or Break Point Analysis. Relevant R packages include strucchange changepoint, as mentioned by Kiril, and bcp.

    strucchange‘s breakpoints() uses least squares regression to estimate the
    locations of changes when told how many changes there are (which is not helpful here.)

    changepoint has several algorithms, as Kiril said, including Scott and Knott’s Binary Segmentation, Auger and Lawrence’s Segment Neighbourhoods, and Killick et al’s Pruned Exact Linear Time (PELT) algorithm. Its a great package, but my very limited experience is that these functions will require a bunch of tuning (which is worth doing).

    For important tasks, we would want to leverage our knowledge of the data to make more detailed model(s) and, ultimately, combine several methods into an ensemble classifier.

    But for simple click and go, you could use bcp which uses an MCMC-based approximation of Barry and Hartigan’s Bayes procedure:

    library(bcp)
    changefit <- bcp(data1)
    plot(changefit)
    

    enter image description here

    One way to segregate the groups would be to pick a posterior probability threshold and split() the data based on it:

    data2 <- data.frame(data=data1, prob = changefit$posterior.prob)
    threshold <- 0.90
    split(data2,c(0, cumsum( ifelse (data2$prob > threshold, 1, 0))))
    #split will warn about unequal lengths
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my data: ID FName LName data1 data2 1 John Doe xxx1 2
Here is some example data: data = data.frame(series = c(1a, 1b, 1e), reading =
Data: Here is sample table(TableA) data ID StartTime EndTime 1 2012-03-22 06:00:00.000 2012-03-22 06:30:00.000
Here is the scenario: I have a visual that displays some data The data
I am sending HTTP GET request and receiving data here: ssize_t numBytes = recvfrom(sock,
I'm learning assembly and I have a very basic loop here segment .data msg:
for (i = 0; i < 14; i++) { //display data here } Console.WriteLine({0},
My html is like this <div id=rsContainer> <table id=rsTable><!-- DATA HERE --></table> </div> and
Here is my data returned from a CMS function: array ( 0 => stdClass::__set_state(array(
here is my data: +----+------------------+--------------------+ | ID | DateTime Entered | DateTime Completed |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.