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
4
votes
2 answers

How can I do Das Gupta decomposition with R?

I want to decompose changes in fertility rate by compositional effect and rate effect using Das Gupta(1993) decomposition methods. Is there code or function for doing Das Gupta decomposition using R? For STATA I find out "rdecompose", but I could…
Justine
  • 41
  • 2
4
votes
1 answer

Oaxaca decomposition on weighted survey data in R

I'd like to implement Oaxaca Decomposition in R. It is used in e.g. labor economics to distinguish explained variance versus unexplained variance. This is fairly easy to do with unweighted data using the Oaxaca package (See previous explanation…
Bobby O
  • 79
  • 7
4
votes
1 answer

How to choose the number of components PCA scikitliear

I'm trying to decompse my columns using PCA . I'm finding some difficulties about how to choose my n_components of the function PCA using scikit learn in python. I did this sc = StandardScaler() Z = sc.fit_transform(X) pca = PCA(n_components =…
Mathilde
  • 39
  • 1
  • 7
4
votes
1 answer

MatLab : chol Matrix must be positive definite

I am trying to fit t copula in MatLab to my data and my function is: u = ksdensity(range_1, range_1,'function','cdf'); v = ksdensity(range_2, range_2,'function','cdf'); %fit a t-copula to returns rng default ; % For reproducibility [Rho,nu] =…
mk_sch
  • 1,060
  • 4
  • 16
  • 31
4
votes
2 answers

Preserve timestamp after decomposing xts in R

I have an xts timeseries called hourplot in R with a period of 24 (hourly data) over two weeks, indexed by timestamp objects of POSIXlt class, like the following: > dput(hourplot) structure(c(1, 1, 1, 1, 1, 1, 1.11221374045802, 1.3368, 1.18,…
Avijit
  • 391
  • 2
  • 21
4
votes
1 answer

Independent component analysis (ICA) in Python

Is there any available package in python to perform Independent Component Analysis (ICA)? please provide some pointers and links so that i can start with python for the same.
Nitin
  • 2,572
  • 5
  • 21
  • 28
4
votes
2 answers

Groovy's inconsistent destructuring / decomposition on lists?

Positive Case: Can get into a list groovy> println GroovySystem.version groovy> final data1 = [[99,2] , [100,4]] groovy> data1.collect{x,y->x+y} 2.2.1 Result: [101, 104] Negative Case: Can not do the same groovy> println GroovySystem.version …
mert inan
  • 1,537
  • 2
  • 15
  • 26
4
votes
1 answer

Homography matrix decomposition into rotation matrix and translation vector

I'm working on an augmented reality application for android using opencv 2.4.4 and have some problem with homography decomposition. As we know, homography matrix is define as H=A.[R t] , where A is the intrinsic camera matrix, R is rotation matrix…
mox
  • 41
  • 1
  • 5
4
votes
2 answers

How to implement LU decomposition with partial pivoting in Python?

I want to implement my own LU decomposition P,L,U = my_lu(A), so that given a matrix A, computes the LU decomposition with partial pivoting. But I only know how to do it without pivoting. Can anyone help to do the partial pivoting? def lu(A): …
4
votes
2 answers

How does the lu( ) function decide what to return?

Let A be the following matrix: 1 3 2 4 if I call the lu( ) function and save the return values like this: [L, U] = lu(A); MATLAB returns L, U such that L * U = A: >> L * U ans = 1 3 2 4 While when I save the return values like…
Haile
  • 3,120
  • 3
  • 24
  • 40
4
votes
2 answers

Decompose integers larger than 100 digits

X and Y are integers larger than 100 digits. Find the integer P which is within the range [X, Y[ and that guaranties the "best" prime decomposition (i.e. the decomposition with the most unique prime factors). What I've done is just check the…
Jonas
  • 1,019
  • 4
  • 20
  • 33
4
votes
2 answers

Nearly Correct Matrix Decomposition Code Fails in Negative Case

I am writing my own matrix class with the methods you would expect to accompany a matrix class. Guts of the code was taken from here Everything seems to work perfectly except for my Decompose method (For more information on what it means to LU…
jth41
  • 3,808
  • 9
  • 59
  • 109
4
votes
1 answer

QR decomposition in RcppArmadillo

Really confused why the QR output using RcppArmadillo is different than QR output from R; Armadillo documentation doesnt give a clear answer either. Essentially when I give R a matrix Y that is n * q (say 1000 X 20 ) , I get back Q which is 1000 X…
pslice
  • 503
  • 1
  • 4
  • 13
3
votes
1 answer

R, incomplete elements in time series decomposition

I am using below codes to perform time series decomposition. a <- c( 4, 3, 2, 12, 6, 6, 13, 9, 9, 11, 8, 6, 15, 3, 3, 4, 4, 12, 14, 11, 3, 10, 5, 5) ts_a = ts(a, frequency = 12) decompose_a = decompose(ts_a,…
Mark K
  • 8,767
  • 14
  • 58
  • 118
3
votes
2 answers

None freq not allowing seasonal_decompose

Trying to apply seasonal_decompose on timeseries data whose freq is irregular. It looks something like this: modal_price Period 2014-11-01 1469 2015-01-01 1258 2015-03-01 1112 2015-04-01 1373 2015-06-01 1370 2015-07-01 …
Vipul Rustagi
  • 75
  • 2
  • 10
1 2
3
22 23