Questions tagged [decomposition]

Decomposition might refer to Time Series Decomposition. Decomposing a time-series into Seasonal and Trend components can be achieved by using several methods, such as STL (which uses a Loess smoothing algorithm).

Prefer using if applicable.


Time series data can exhibit a variety of patterns, and it is often helpful to split a time series into several components, each representing an underlying pattern category.

There are three types of time series patterns: trend, seasonality and cycles. When we decompose a time series into components, we usually combine the trend and cycle into a single trend-cycle component (often just called the trend for simplicity). Thus we can think of a time series as comprising three components: a trend-cycle component, a seasonal component, and a remainder component (containing anything else in the time series). For some time series (e.g., those that are observed at least daily), there can be more than one seasonal component, corresponding to the different seasonal periods.

345 questions
7
votes
1 answer

Greedy algorithm for finding a negafibonacci representation of a number?

According to Zeckendorf's theorem, every positive integer can be written in a unique way as the sum of non-consecutive distinct Fibonacci numbers. Such a decomposition can be found easily with a greedy algorithm consisting essentially in subtracting…
7
votes
2 answers

Historical Decomposition In R

I'm currently trying to run a historical decomposition on my data series in R. I've read a ton of papers and they all provide the following explanation of how to do a historical decomposition: Where the sum on the right hand side is a "dynamic…
Gin_Salmon
  • 837
  • 1
  • 7
  • 19
6
votes
3 answers

Dual seasonal cycles in ts object

I want to strip out seasonality from a ts. This particular ts is daily, and has both yearly and weekly seasonal cycles (frequency 365 and 7). In order to remove both, I have tried conducting stl() on the ts with frequency set to 365, before…
Jonathan Mulligan
  • 352
  • 2
  • 3
  • 10
5
votes
2 answers

Axis must have `freq` set to convert to Periods | Seasonal_Decompose

I have a temp DF that has the following data in it Quarter 2016Q3 146660510.0 2016Q4 123641451.0 2017Q1 125905843.0 2017Q2 129656327.0 2017Q3 126586708.0 2017Q4 116804168.0 2018Q1 118167263.0 2018Q2 121633740.0 2018Q3 …
5
votes
2 answers

StandardScaler difference between "with_std=False or True" and "with_mean=False or True"

I am trying to standardize some data to be able to apply PCA to it. I am using sklearn.preprocessing.StandardScaler. I am having trouble to understand the difference between using True or False in the parameters with_mean and with_std…
alvaro otero
  • 51
  • 1
  • 2
5
votes
2 answers

Decomposing Time-Series Data: "no or less than 2 periods"

I have a string a time-series data which I am trying to decompose. Each data-point corresponds to the start date of a given month and looks something like: A <- c(5,6,7,8,9,8,5,6,10,11) I convert the data to a time-series using the following: A1 <-…
costebk08
  • 1,299
  • 4
  • 17
  • 42
5
votes
0 answers

PySpark PCA: avoiding NotConvergedException

I'm attempting to reduce a wide dataset (51 features, ~1300 individuals) using PCA through the ml.linalg method as follows: 1) Named my columns as one list: features = indi_prep_df.select([c for c in indi_prep_df.columns if c not…
MisterJT
  • 412
  • 4
  • 15
5
votes
2 answers

Flatten or detrend a seasonal time series

I have a repeating time series with a seasonal (weekly) pattern, and I'd like to return the same time series with no week-over-week trend, taking the first value as a starting point. To be specific, the 1st value will still be 39.8, but the 8th…
Eric
  • 177
  • 1
  • 7
5
votes
1 answer

Lossless decomposition vs Dependency Preservation

Does anyone of them implies the other? My logic is that if all dependencies are preserved, then there is no loss of information and similarly, if decomposition is lossless then no functional dependency must have been violated. So essentially,…
5
votes
5 answers

Decomposition in java, when is enough enough?

I'm a first year computer science student. We are currently programming in java and I often try decompose my program into well named methods so that my main method logic can read as close to pseudo-code as possible. The problem I find is that often…
kontrarian
  • 558
  • 2
  • 7
  • 16
5
votes
1 answer

fourier() vs fourierf() function in R

I'm using the fourier() and fourierf() functions in Ron Hyndman's excellent forecast package in R. Looking to verify whether the same terms are selected and used in fourier() and fourierf(), I plotted a few of the output terms. Below is the…
Bryan
  • 5,999
  • 9
  • 29
  • 50
5
votes
4 answers

Print all unique integer partitions given an integer as input

I was solving a programming exercise and came across a problem over which I am not able to satisfactorily find a solution. The problem goes as follows: Print all unique integer partitions given an integer as input. Integer partition is a way of…
5
votes
3 answers

LU decomposition with partial pivoting Matlab

I am trying to implement my own LU decomposition with partial pivoting. My code is below and apparently is working fine, but for some matrices it gives different results when comparing with the built-in [L, U, P] = lu(A) function in matlab Can…
BRabbit27
  • 6,333
  • 17
  • 90
  • 161
4
votes
1 answer

Destructure Reactive object in Vue script setup

I'm following the Vue 3 documents on how to move to using the