Questions tagged [autoregressive-models]

In statistics and signal processing, an autoregressive (AR) model is a representation of a type of random process; it describes the relationships of values at prior times to those of current times (as well as for covariates) during time-varying processes in nature, economics, etc.

In statistics and signal processing, an autoregressive (AR) model is a representation of a type of random process; as such, it describes certain time-varying processes in nature, economics, etc.

The autoregressive model specifies that the output variable depends linearly on its own previous values. It is a special case of the more general ARMA model of time series.

Wikipedia: http://en.wikipedia.org/wiki/Autoregressive_model

204 questions
15
votes
3 answers

How to fit autoregressive poisson mixed model (count time series) in R?

My task is to assess how various environmental variables affect annual population fluctuations. For this, I need to fit poisson autoregressive model for time-series counts: Where Ni,j is the count of observed individuals at site i in year j,…
Tomas
  • 57,621
  • 49
  • 238
  • 373
8
votes
1 answer

Using sample_weights with fit_generator()

Inside an autoregressive continuous problem, when the zeros take too much place, it is possible to treat the situation as a zero-inflated problem (i.e. ZIB). In other words, instead of working to fit f(x), we want to fit g(x)*f(x) where f(x) is the…
7
votes
1 answer

Choosing specific lags in ARIMA or VAR Model

I've seen this issue raised here and here but unfortunately the answers are not satisfactory. Inputting the lags in either the p argument in VAR or the order argument in arima, R will include all the lags at and below that stated value. However,…
gtnbz2nyt
  • 1,465
  • 3
  • 17
  • 33
6
votes
2 answers

Statsmodels ARMA training data vs test data for prediction

I'm trying to test ARMA models, and working through the examples provided here: http://www.statsmodels.org/dev/examples/notebooks/generated/tsa_arma_0.html I can't tell if there is a straightforward way to train a model on a training dataset then…
Troy D
  • 2,093
  • 1
  • 14
  • 28
6
votes
1 answer

Prediction intervals for ARMA.predict

The Summary of an ARMA prediction for time series (print arma_mod.summary()) shows some numbers about the confidence interval. Is it possible to use these numbers as prediction intervals in the plot which shows predicted values? ax =…
5
votes
1 answer

Autoregressive model using statsmodels in Python

I am trying to start using the AR models in statsmodels. However, I seem to be doing something wrong. Consider the following example, which fails: from statsmodels.tsa.ar_model import AR import numpy as np signal = np.ones(20) ar_mod =…
Chris
  • 899
  • 2
  • 17
  • 25
5
votes
2 answers

ar(1) simulation with non-zero mean

I can't seem to find the correct way to simulate an AR(1) time series with a mean that is not zero. I need 53 data points, rho = .8, mean = 300. However, arima.sim(list(order=c(1,0,0), ar=.8), n=53, mean=300, sd=21) gives me values in the 1500s. For…
ShariDB
  • 159
  • 1
  • 11
4
votes
1 answer

Adaptive modelling using GEKKO sysid

I have 100 points of data that I'm trying to describe using sysid in GEKKO. At some point ( t = 50 in this case) the data changes significantly and the prediction is no longer accurate. I'm trying to include an if statement that evaluates actual vs…
reyPanda
  • 510
  • 2
  • 11
4
votes
1 answer

How to generate sequence data with keras with multiple input?

I'm writing a VAE for sequence to sequence problem in keras. The decoder is an auto-regressive model so I have two different inputs, one for the encoder and the same (shifted by 1, but this is not the problem) for the decoder. I want also to do data…
4
votes
1 answer

Auto.arima() function does not result in white noise. How else should I go about modeling data

Here is the plot of the initial data (after performing a log transformation). It is evident there is both a linear trend as well as a seasonal trend. I can address both of these by taking the first and twelfth (seasonal) difference:…
4
votes
1 answer

python arma fitting running too slow?

I am doing this assignment where I am trying to run this program 5000 times and do an AR(1) and AR(2) fit to the model. First I defined a function that generated a time series as follows: def ts_gen_ar1(size,sigma,alpha1): wt =…
3
votes
2 answers

Gekko ARX models where data needs cutting

I am used to using commercial packages for linear model identification. In these packages, a section of the step test data can be marked as bad (e.g. when the unit tripped or was operating abnormally). I have been using the Gekko ARX routine to give…
3
votes
1 answer

How to early-stop autoregressive model with a list of stop words?

I am using GPT-Neo model from transformers to generate text. Because the prompt I use starts with '{', so I would like to stop the sentence once the paring '}' is generated. I found that there is a StoppingCriteria method in the source code but…
3
votes
3 answers

How to forecast time series using AutoReg in python

I'm trying to build old school model using only auto regression algorithm. I found out that there's an implementation of it in statsmodel package. I've read the documentation, and as I understand it should work as ARIMA. So, here's my code: import…
Yoskutik
  • 1,859
  • 2
  • 17
  • 43
3
votes
1 answer

Applying statsmodels Autoregression function on all pandas dataframe columns

I am trying to fit Autoregressive model on some data which is in pandas dataframe. My current code:- import pandas as pd import statsmodels.tsa.api as smt store=[] df = pd.DataFrame({'A':[0.345, 0.985, 0.912, 0.645, 0.885, 0.121], …
1
2 3
13 14