Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
arash rad
arash rad le 6 Oct 2022
Commenté : Hiro Yoshino le 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 commentaire
Hiro Yoshino
Hiro Yoshino le 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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by