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

4 次查看(过去 30 天)
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 个评论
Hiro Yoshino
Hiro Yoshino 2022-11-20
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.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by