Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
arash rad
arash rad el 6 de Oct. de 2022
Comentada: Hiro Yoshino el 20 de Nov. de 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 comentario
Hiro Yoshino
Hiro Yoshino el 20 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by