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
39
votes
9 answers

Generating the partitions of a number

I needed an algorithm to generate all possible partitions of a positive number, and I came up with one (posted as an answer), but it's exponential time. The algorithm should return all the possible ways a number can be expressed as the sum of…
Can Berk Güder
  • 109,922
  • 25
  • 130
  • 137
32
votes
2 answers

Decomposing a relation into BCNF

I'm having trouble establishing when a relation is in Boyce-Codd Normal Form and how to decompose it info BCNF if it is not. Given this example: R(A, C, B, D, E) with functional dependencies: A -> B, C -> D How do I go about decomposing it? The…
raphnguyen
  • 3,565
  • 18
  • 56
  • 74
30
votes
8 answers

decompose() for time series: ValueError: You must specify a period or x must be a pandas object with a DatetimeIndex with a freq not set to None

I have some problems executing an additive model right. I have the following data frame: And when I run this code: import statsmodels as sm import statsmodels.api as sm decomposition = sm.tsa.seasonal_decompose(df, model = 'additive') fig =…
and_and
  • 435
  • 1
  • 4
  • 8
30
votes
6 answers

glm - Decompose mat4 into translation and rotation?

For purposes of lerping I need to decompose a 4x4 matrix into a quaternion and a vec3. Grabbing the quaternion is simple, as you can just pass the matrix into the constructor, but I can't find a way to grab the translation. Surely there must be a…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
28
votes
5 answers

Tuples and unpacking assignment support in C#?

In Python I can write def myMethod(): #some work to find the row and col return (row, col) row, col = myMethod() mylist[row][col] # do work on this element But in C# I find myself writing out int[] MyMethod() { // some work to find…
jb.
  • 9,921
  • 12
  • 54
  • 90
23
votes
2 answers

SKLearn 0.20.2 - Import error with RandomizedPCA?

I'm trying to do the Udacity mini project and I've got the latest version of the SKLearn library installed (20.2). When I run: from sklearn.decomposition import RandomizedPCA I get the error: ImportError: cannot import name 'RandomizedPCA' from…
Aaraeus
  • 1,105
  • 3
  • 14
  • 26
19
votes
4 answers

Time series and stl in R: Error only univariate series are allowed

I am doing analysis on hourly precipitation on a file that is disorganized. However, I managed to clean it up and store it in a dataframe (called CA1) which takes the form as followed: Station_ID Guage_Type Lat Long Date Time_Zone…
Luciano Rodriguez
  • 719
  • 4
  • 9
  • 16
16
votes
3 answers

value error in python statsmodels.tsa.seasonal

I have this dataframe with date time indices: ts_log: date price_per_unit 2013-04-04 12.762369 2013-04-05 12.777120 2013-04-06 12.773146 2013-04-07 12.780774 2013-04-08 12.786835 I have this piece of code for decomposition from…
Reza
  • 728
  • 1
  • 10
  • 28
10
votes
6 answers

How to move a method from a class to another class when two classes are not at all related

I am trying to re factor some code by breaking a class into several other classes. to do so i want to move some methods already existing in my old class to new class. But these methods are being referred in a lot of places and manually updating the…
10
votes
2 answers

Convert Unicode decomposition when transferring files to web server

I am doing website development on OS X, and fairly often I find myself in situations where I move some part of a live website (running Linux/LAMP) to a development server running on my own machine. One such instance involves downloading images (user…
Simon
  • 3,667
  • 1
  • 35
  • 49
10
votes
2 answers

Decompose complex matrix transformation into a series of simple transformations?

I wonder if it is possible (and if it is then how) to re-present an arbitrary M3 matrix transformation as a sequence of simpler transformations (such as translate, scale, skew, rotate) In other words: how to calculate MTranslate, MScale, MRotate,…
Sergey Ilinsky
  • 31,255
  • 9
  • 54
  • 56
9
votes
3 answers

Plotting communities with python igraph

I have a graph g in python-igraph. I can get a VertexCluster community structure with the following: community = g.community_multilevel() community.membership gives me a list of the group membership of all the vertices in the graph. My question is…
jayelm
  • 7,236
  • 5
  • 43
  • 61
8
votes
5 answers

Generating all distinct partitions of a number

I am trying to write a C code to generate all possible partitions (into 2 or more parts) with distinct elements of a given number. The sum of all the numbers of a given partition should be equal to the given number. For example, for input n = 6, all…
mayank
  • 318
  • 1
  • 2
  • 8
7
votes
1 answer

Svg matrix decomposition

In svg we have method element.getCTM() which returns a SVGMatrix as: [a c e][b d f][0 0 1] I want to calculate sx , sy and angle of rotation from this matrix.
rsk
  • 81
  • 1
  • 6
7
votes
2 answers

seasonal_decompose: operands could not be broadcast together with shapes on a series

I know there are many questions on this topic, but none of them helped me to solve this problem. I'm really stuck on this. With a simple series: 0 2016-01-31 266 2016-02-29 235 2016-03-31 347 2016-04-30 514 2016-05-31 374 2016-06-30 …
Marco Goldin
  • 120
  • 1
  • 8
1
2 3
22 23