How do you predict future values of a time series? [duplicate]

2

I have values from a time series with a sampling every 5 minutes. How can I predict future values using only this information? How can I model something over a period of time and use it to predict in the future (am I trying to predict the value of glucose in a person)? How to predict the values if by chance the sampling frequency is not constant?

As I am not very knowledgeable in the matter, some tutorials would be welcome along with your possible explanations.

PS: I need to first understand the theory and then realize it in practice;)

    
asked by anonymous 14.04.2015 / 10:55

2 answers

0

I'm not the right person to give you this answer ...

Still, there's a simplicist boot:

  • associated with a forecast of future values there is usually the choice of a "model" of expected data behavior (eg linear model, polynomial, frame, splines). This model has to do with with the concrete plot, and can sometimes be "guessed" based on existing data.

  • Based on the model and the existing data, we can determine the model function constants; and based on this determine the expected value for a future instant and its confidence.

I suggest you start with some text linked to:

  • Machine Learning; time series;
  • It is customary to use languages related to statistics (Example R) that contain some prediction-related libraries. link
14.04.2015 / 13:36
0

The critical point to predict is to calculate the series autocorrelation. This is how past values influence the determination of future values. Then you have to analyze whether this relationship is linear, in which case you have many options for modeling time series using regression models.

Various other information and links can be found in this question similar

An example with simulated data is shown below

%# Gerar uma variável aleatória autocorrelacionada em 3 períodos.
T = 1000;
%
RV = zeros(T, 1); RV(1)=10+randn(1); RV(2)=1.5+.8*RV(1)+randn(1);
RV(3)=1.5+.8*RV(1)-.3*RV(1)+randn(1);
for c = 4:T ; RV(c)=1.5+.8*RV(c-1)-.3*RV(c-2)+.25*RV(c-3)+randn(1); end

% Pode iniciar aqui fazendo RV = SuaVariavel

plot(RV)

%# Construindo as variaveis com 3 defasagens
yout = RV(4:end); %# dependente
X1 = RV(3:end-1); %# defasagens da dependente (1er regressor)
X2 = RV(2:end-2);
X3 = RV(1:end-3);
%# matriz de regressores incluindo constante
X_train = [ones(length(X1), 1), X1, X2, X3];

%# MQO
mdl = regress(yout, X_train);
mdl

# Prever
X_test = [1, RV(T-1), RV(T-2), RV(T-3)];
%pred = predict(mdl,X_test);
sum(mdl'.*X_test) ; % Y em T+1
    
06.06.2015 / 21:51