how to assign a value to AR model for predicting next step

3 Ansichten (letzte 30 Tage)
arash rad
arash rad am 6 Okt. 2022
Kommentiert: Hiro Yoshino am 20 Nov. 2022
Hello everyone
I have a code and i estimate a model with AR (auto regressive) and I want to predict next step but it only returns the equation and do not assign value to variable in the equation(z)
Thank you for helping me
clc
clear all
close all
warning off
zafar_queue =readtable('zafar_queue.xlsx');
Y = zafar_queue.nVehContrib;
data = Y';
x_train = floor(0.9*numel(data));
dataTrain =data(1:x_train);
n = length(dataTrain);
u = 0.1* randn(n,1) ;
Opt = arxOptions;
Opt.InitialCondition = 'estimate';
arx30 = @(z)ar(dataTrain,[30], Opt);
z = 3
frcast = arx30(z)
Result after running code is this and it didn't assign 3 to z
  1 Kommentar
Hiro Yoshino
Hiro Yoshino am 20 Nov. 2022
arx30 = @(z)ar(dataTrain,[30], Opt);
This syntax does not do anything for you.
"z" is an argument of the anonymous function arx30 but the "z" is not used for anything.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by