<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vertica Documentation – Time series forecasting</title>
    <link>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/</link>
    <description>Recent content in Time series forecasting on Vertica Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/data-analysis/ml-predictive-analytics/time-series-forecasting/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Data-Analysis: ARIMA model example</title>
      <link>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/arima-model-example/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/arima-model-example/</guid>
      <description>
        
        
        &lt;p&gt;Autoregressive integrated moving average (ARIMA) models combine the abilities of &lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/autoregressor/&#34;&gt;AUTOREGRESSOR&lt;/a&gt; and &lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/moving-average/&#34;&gt;MOVING_AVERAGE&lt;/a&gt; models by making future predictions based on both preceding time series values and errors of previous predictions. At model training time, you specify the number of preceding values and previous prediction errors that the model will use to calculate predictions.&lt;/p&gt;
&lt;p&gt;You can use the following functions to train and make predictions with ARIMA models:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/arima/&#34;&gt;ARIMA&lt;/a&gt;&lt;/code&gt;:				Creates and trains an ARIMA model&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-arima/&#34;&gt;PREDICT_ARIMA&lt;/a&gt;&lt;/code&gt;:				Applies a trained ARIMA model to an input relation or makes predictions using the in-sample data&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These functions require time series data with consistent timesteps. To normalize a time series with inconsistent timesteps, see &lt;a href=&#34;../../../../en/data-analysis/time-series-analytics/gap-filling-and-interpolation-gfi/&#34;&gt;Gap filling and interpolation (GFI)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following example trains an ARIMA model on a daily temperature dataset and then makes temperature predictions with both possible prediction methods—using the in-sample data and applying the model to an input relation.&lt;/p&gt;
&lt;h2 id=&#34;load-the-training-data&#34;&gt;Load the training data&lt;/h2&gt;
Before you begin the example, &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/download-ml-example-data/&#34;&gt;load the Machine Learning sample data&lt;/a&gt;.
&lt;p&gt;This examples uses the daily-min-temperatures dataset, which contains data on the daily minimum temperature in Melbourne, Australia from 1981 through 1990. The data is available in the &lt;code&gt;temp_data&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM temp_data;
        time         | Temperature
---------------------+-------------
 1981-01-01 00:00:00 |        20.7
 1981-01-02 00:00:00 |        17.9
 1981-01-03 00:00:00 |        18.8
 1981-01-04 00:00:00 |        14.6
 1981-01-05 00:00:00 |        15.8
 ...
 1990-12-27 00:00:00 |          14
 1990-12-28 00:00:00 |        13.6
 1990-12-29 00:00:00 |        13.5
 1990-12-30 00:00:00 |        15.7
 1990-12-31 00:00:00 |          13
(3650 rows)

=&amp;gt; SELECT COUNT(*) FROM temp_data;
 COUNT
-------
3650
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;train-the-arima-model&#34;&gt;Train the ARIMA model&lt;/h2&gt;
&lt;p&gt;After you load the data, you can use the &lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/arima/&#34;&gt;ARIMA&lt;/a&gt; function to create and train an ARIMA model. For this example, the model is trained with lags of &lt;code&gt;p&lt;/code&gt;=3 and &lt;code&gt;q&lt;/code&gt;=3, taking the value and prediction error of three previous time steps into account for each prediction:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT ARIMA(&amp;#39;arima_temp&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;temperature&amp;#39;, &amp;#39;time&amp;#39; USING PARAMETERS p=3, q=3);
                             ARIMA
--------------------------------------------------------------
Finished in 20 iterations.
3650 elements accepted, 0 elements rejected.

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can view a summary of the model with the &lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt; function:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GET_MODEL_SUMMARY(USING PARAMETERS model_name=&amp;#39;arima_temp&amp;#39;);
               GET_MODEL_SUMMARY
-----------------------------------------------

============
coefficients
============
parameter| value
---------+--------
  phi_1  | 0.64189
  phi_2  | 0.46667
  phi_3  |-0.11777
 theta_1 |-0.05109
 theta_2 |-0.58699
 theta_3 |-0.15882


==============
regularization
==============
none

===============
timeseries_name
===============
temperature

==============
timestamp_name
==============
time

==============
missing_method
==============
linear_interpolation

===========
call_string
===========
ARIMA(&amp;#39;public.arima_temp&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;temperature&amp;#39;, &amp;#39;time&amp;#39; USING PARAMETERS p=3, d=0, q=3, missing=&amp;#39;linear_interpolation&amp;#39;, init_method=&amp;#39;Zero&amp;#39;, epsilon=1e-06, max_iterations=100);

===============
Additional Info
===============
       Name       | Value
------------------+--------
        p         |   3
        q         |   3
        d         |   0
       mean       |11.17775
      lambda      | 1.00000
mean_squared_error| 5.80490
rejected_row_count|   0
accepted_row_count|  3650

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;make-predictions&#34;&gt;Make predictions&lt;/h2&gt;
&lt;p&gt;After you train the ARIMA model, you can call the 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-arima/&#34;&gt;PREDICT_ARIMA&lt;/a&gt;&lt;/code&gt; function to predict future temperatures. This function supports making predictions using the in-sample data that the model was trained on or applying the model to an input relation.&lt;/p&gt;
&lt;h3 id=&#34;using-in-sample-data&#34;&gt;Using in-sample data&lt;/h3&gt;
&lt;p&gt;The following example makes predictions using the in-sample data that the model was trained on. The model begins prediction at the end of the &lt;code&gt;temp_data&lt;/code&gt; table and returns predicted values for ten timesteps:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_ARIMA(USING PARAMETERS model_name=&amp;#39;arima_temp&amp;#39;, start=0, npredictions=10) OVER();
   prediction
------------------
12.9745063293842
13.4389080858551
13.3955791360528
13.3551146487462
13.3149336514747
13.2750516811057
13.2354710353376
13.1961939790513
13.1572226788109
13.1185592045127
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For both prediction methods, if you want the function to return the standard error of each prediction, you can set &lt;code&gt;output_standard_errors&lt;/code&gt; to true:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_ARIMA(USING PARAMETERS model_name=&amp;#39;arima_temp&amp;#39;, start=0, npredictions=10, output_standard_errors=true) OVER();
    prediction    |     std_err
------------------+------------------
 12.9745063293842 | 1.00621890780865
 13.4389080858551 | 1.45340836833232
 13.3955791360528 | 1.61041524562932
 13.3551146487462 | 1.76368421116143
 13.3149336514747 | 1.91223938476627
 13.2750516811057 | 2.05618464609977
 13.2354710353376 | 2.19561771498385
 13.1961939790513 | 2.33063553781651
 13.1572226788109 | 2.46133422924445
 13.1185592045127 | 2.58780904243988
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;applying-to-an-input-relation&#34;&gt;Applying to an input relation&lt;/h3&gt;
&lt;p&gt;You can also apply the model to an input relation, in this case the &lt;code&gt;temp_data&lt;/code&gt; training set:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_ARIMA(temperature USING PARAMETERS model_name=&amp;#39;arima_temp&amp;#39;, start=3651, npredictions=10, output_standard_errors=true) OVER(ORDER BY time) FROM temp_data;
    prediction    |     std_err
------------------+------------------
 12.9745063293842 | 1.00621890780865
 13.4389080858551 | 1.45340836833232
 13.3955791360528 | 1.61041524562932
 13.3551146487462 | 1.76368421116143
 13.3149336514747 | 1.91223938476627
 13.2750516811057 | 2.05618464609977
 13.2354710353376 | 2.19561771498385
 13.1961939790513 | 2.33063553781651
 13.1572226788109 | 2.46133422924445
 13.1185592045127 | 2.58780904243988
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Because the same data and relative start index were provided to both prediction methods, the model predictions for each method are identical.&lt;/p&gt;
&lt;p&gt;When applying a model to an input relation, you can set &lt;code&gt;add_mean&lt;/code&gt; to false so that the function returns the predicted difference from the mean instead of the sum of the model mean and the predicted difference:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_ARIMA(temperature USING PARAMETERS model_name=&amp;#39;arima_temp&amp;#39;, start=3680, npredictions=10, add_mean=false) OVER(ORDER BY time) FROM temp_data;
  prediction
------------------
1.2026877112171
1.17114068517961
1.13992534953432
1.10904183333367
1.0784901998692
1.04827044781798
1.01838251238116
0.98882626641461
0.959601521551628
0.93070802931751
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/arima/&#34;&gt;ARIMA&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-arima/&#34;&gt;PREDICT_ARIMA&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-evaluation/mse/&#34;&gt;MSE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: Autoregressive model example</title>
      <link>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/autoregressive-model-example/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/autoregressive-model-example/</guid>
      <description>
        
        
        &lt;p&gt;Autoregressive models predict future values of a time series based on the preceding values. More specifically, the user-specified &lt;em&gt;lag&lt;/em&gt; determines how many previous timesteps it takes into account during computation, and predicted values are linear combinations of the values at each lag.&lt;/p&gt;

&lt;p&gt;Use the following functions when training and predicting with autoregressive models. Note that these functions require datasets with consistent timesteps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/autoregressor/&#34;&gt;AUTOREGRESSOR&lt;/a&gt;&lt;/code&gt;: trains an autoregressive model&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-autoregressor/&#34;&gt;PREDICT_AUTOREGRESSOR&lt;/a&gt;&lt;/code&gt;: applies the model to a dataset to make predictions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To normalize datasets with inconsistent timesteps, see &lt;a href=&#34;../../../../en/data-analysis/time-series-analytics/gap-filling-and-interpolation-gfi/&#34;&gt;Gap filling and interpolation (GFI)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Load the datasets from the &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/download-ml-example-data/&#34;&gt;Machine-Learning-Examples&lt;/a&gt; repository.&lt;/p&gt;
&lt;p&gt;This example uses the daily-min-temperatures dataset, which contains data on the daily minimum temperature in Melbourne, Australia from 1981 through 1990:&lt;/p&gt;

&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM temp_data;
        time         | Temperature
---------------------+-------------
 1981-01-01 00:00:00 |        20.7
 1981-01-02 00:00:00 |        17.9
 1981-01-03 00:00:00 |        18.8
 1981-01-04 00:00:00 |        14.6
 1981-01-05 00:00:00 |        15.8
...
 1990-12-27 00:00:00 |          14
 1990-12-28 00:00:00 |        13.6
 1990-12-29 00:00:00 |        13.5
 1990-12-30 00:00:00 |        15.7
 1990-12-31 00:00:00 |          13
(3650 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/autoregressor/&#34;&gt;AUTOREGRESSOR&lt;/a&gt;&lt;/code&gt; to create the autoregressive model &lt;code&gt;AR_temperature&lt;/code&gt; from the &lt;code&gt;temp_data&lt;/code&gt; dataset. In this case, the model is trained with a lag of &lt;code&gt;p&lt;/code&gt;=3, taking the previous 3 entries into account for each estimation:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT AUTOREGRESSOR(&amp;#39;AR_temperature&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;Temperature&amp;#39;, &amp;#39;time&amp;#39; USING PARAMETERS p=3);
                    AUTOREGRESSOR
---------------------------------------------------------
 Finished. 3650 elements accepted, 0 elements rejected.
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can view a summary of the model with 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT GET_MODEL_SUMMARY(USING PARAMETERS model_name=&amp;#39;AR_temperature&amp;#39;);

 GET_MODEL_SUMMARY
-------------------

============
coefficients
============
parameter| value
---------+--------
  alpha  | 1.88817
phi_(t-1)| 0.70004
phi_(t-2)|-0.05940
phi_(t-3)| 0.19018


==================
mean_squared_error
==================
not evaluated

===========
call_string
===========
autoregressor(&amp;#39;public.AR_temperature&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;temperature&amp;#39;, &amp;#39;time&amp;#39;
USING PARAMETERS p=3, missing=linear_interpolation, regularization=&amp;#39;none&amp;#39;, lambda=1, compute_mse=false);

===============
Additional Info
===============
       Name       |Value
------------------+-----
    lag_order     |  3
rejected_row_count|  0
accepted_row_count|3650
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-autoregressor/&#34;&gt;PREDICT_AUTOREGRESSOR&lt;/a&gt;&lt;/code&gt; to predict future temperatures. The following query &lt;code&gt;start&lt;/code&gt;s the prediction at the end of the dataset and returns 10 predictions.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_AUTOREGRESSOR(Temperature USING PARAMETERS model_name=&amp;#39;AR_temperature&amp;#39;, npredictions=10) OVER(ORDER BY time) FROM temp_data;

    prediction
------------------
 12.6235419917807
 12.9387860506032
 12.6683380680058
 12.3886937385419
 12.2689506237424
 12.1503023330142
 12.0211734746741
 11.9150531529328
 11.825870404008
 11.7451846722395
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: Moving-average model example</title>
      <link>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/moving-average-model-example/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/time-series-forecasting/moving-average-model-example/</guid>
      <description>
        
        
        &lt;p&gt;Moving average models use the errors of previous predictions to make future predictions. More specifically, the user-specified &lt;em&gt;lag&lt;/em&gt; determines how many previous predictions and errors it takes into account during computation.&lt;/p&gt;

&lt;p&gt;Use the following functions when training and predicting with moving-average models. Note that these functions require datasets with consistent timesteps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/moving-average/&#34;&gt;MOVING_AVERAGE&lt;/a&gt;&lt;/code&gt;: trains a moving-average model&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-moving-average/&#34;&gt;PREDICT_MOVING_AVERAGE&lt;/a&gt;&lt;/code&gt;: applies the model to a dataset to make predictions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To normalize datasets with inconsistent timesteps, see &lt;a href=&#34;../../../../en/data-analysis/time-series-analytics/gap-filling-and-interpolation-gfi/&#34;&gt;Gap filling and interpolation (GFI)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Load the datasets from the &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/download-ml-example-data/&#34;&gt;Machine-Learning-Examples&lt;/a&gt; repository.&lt;/p&gt;
&lt;p&gt;This example uses the daily-min-temperatures dataset, which contains data on the daily minimum temperature in Melbourne, Australia from 1981 through 1990:&lt;/p&gt;

&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM temp_data;
        time         | Temperature
---------------------+-------------
 1981-01-01 00:00:00 |        20.7
 1981-01-02 00:00:00 |        17.9
 1981-01-03 00:00:00 |        18.8
 1981-01-04 00:00:00 |        14.6
 1981-01-05 00:00:00 |        15.8
...
 1990-12-27 00:00:00 |          14
 1990-12-28 00:00:00 |        13.6
 1990-12-29 00:00:00 |        13.5
 1990-12-30 00:00:00 |        15.7
 1990-12-31 00:00:00 |          13
(3650 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/moving-average/&#34;&gt;MOVING_AVERAGE&lt;/a&gt;&lt;/code&gt; to create the moving-average model &lt;code&gt;MA_temperature&lt;/code&gt; from the &lt;code&gt;temp_data&lt;/code&gt; dataset. In this case, the model is trained with a lag of &lt;code&gt;p&lt;/code&gt;=3, taking the error of 3 previous predictions into account for each estimation:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MOVING_AVERAGE(&amp;#39;MA_temperature&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;temperature&amp;#39;, &amp;#39;time&amp;#39; USING PARAMETERS q=3, missing=&amp;#39;linear_interpolation&amp;#39;, regularization=&amp;#39;none&amp;#39;, lambda=1);
                    MOVING_AVERAGE
---------------------------------------------------------
 Finished. 3650 elements accepted, 0 elements rejected.
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can view a summary of the model with 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT GET_MODEL_SUMMARY(USING PARAMETERS model_name=&amp;#39;MA_temperature&amp;#39;);

 GET_MODEL_SUMMARY
-------------------

============
coefficients
============
parameter| value
---------+--------
phi_(t-0)|-0.90051
phi_(t-1)|-0.10621
phi_(t-2)| 0.07173


===============
timeseries_name
===============
temperature

==============
timestamp_name
==============
time

===========
call_string
===========
moving_average(&amp;#39;public.MA_temperature&amp;#39;, &amp;#39;temp_data&amp;#39;, &amp;#39;temperature&amp;#39;, &amp;#39;time&amp;#39;
USING PARAMETERS q=3, missing=linear_interpolation, regularization=&amp;#39;none&amp;#39;, lambda=1);

===============
Additional Info
===============
       Name       | Value
------------------+--------
       mean       |11.17780
    lag_order     |   3
      lambda      | 1.00000
rejected_row_count|   0
accepted_row_count|  3650

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-moving-average/&#34;&gt;PREDICT_MOVING_AVERAGE&lt;/a&gt;&lt;/code&gt; to predict future temperatures. The following query &lt;code&gt;start&lt;/code&gt;s the prediction at the end of the dataset and returns 10 predictions.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_MOVING_AVERAGE(Temperature USING PARAMETERS model_name=&amp;#39;MA_temperature&amp;#39;, npredictions=10) OVER(ORDER BY time) FROM temp_data;

    prediction
------------------
 13.1324365636272
 12.8071086272833
 12.7218966671721
 12.6011086656032
 12.506624729879
 12.4148247026733
 12.3307873804812
 12.2521385975133
 12.1789741993396
 12.1107640076638
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
  </channel>
</rss>
