Expected a string scalar or character vector for the parameter name

24 ビュー (過去 30 日間)
Adis Hamzic
Adis Hamzic 2019 年 4 月 1 日
編集済み: Adis Hamzic 2019 年 4 月 1 日
When I try to run code for "Forecast Multiplicative ARIMA Model" example (https://es.mathworks.com/help/econ/forecast-airline-passenger-counts.html) I get the message "expected a string scalar or character vector for the parameter name".
This part works fine:
load(fullfile(matlabroot,'examples','econ','Data_Airline.mat'))
y = log(Data);
T = length(y);
Mdl = arima('Constant',0,'D',1,'Seasonality',12,...
'MALags',1,'SMALags',12);
EstMdl = estimate(Mdl,y);
but when I try:
[yF,yMSE] = forecast(EstMdl,60,y);
then i get above mentioned message.
  2 件のコメント
Adam Danz
Adam Danz 2019 年 4 月 1 日
Could you share the full copy-pasted error message?
Adis Hamzic
Adis Hamzic 2019 年 4 月 1 日
Adam, here is complete code and error:
>> load(fullfile(matlabroot,'examples','econ','Data_Airline.mat'))
>> y = log(Data);
T = length(y);
Mdl = arima('Constant',0,'D',1,'Seasonality',12,...
'MALags',1,'SMALags',12);
EstMdl = estimate(Mdl,y);
ARIMA(0,1,1) Model Seasonally Integrated with Seasonal MA(12):
---------------------------------------------------------------
Conditional Probability Distribution: Gaussian
Standard t
Parameter Value Error Statistic
----------- ----------- ------------ -----------
Constant 0 Fixed Fixed
MA{1} -0.377162 0.0667944 -5.64661
SMA{12} -0.572378 0.0854395 -6.69923
Variance 0.00126337 0.00012395 10.1926
>> [yF,yMSE] = forecast(EstMdl,60,y);
Expected a string scalar or character vector for the parameter name.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2019 年 4 月 1 日
編集済み: Adam Danz 2019 年 4 月 1 日
The help section of the forecast() function shows that there are two inputs and then you can enter optional parameter-value pairs.
help forecast
% [Y,YMSE,V] = forecast(Mdl, numPeriods, param1,val1,param2,val2,...)
If you're checking the predictive performance of the model, the paramter name you might be missing is 'Y0'.
[yF,yMSE] = forecast(EstMdl,60,'Y0',y);
% **
But check the other name-value pairs to be sure about what you're specifying here.
Recent version of matlab:
Older versions of matlab
  1 件のコメント
Adis Hamzic
Adis Hamzic 2019 年 4 月 1 日
編集済み: Adis Hamzic 2019 年 4 月 1 日
Thank you Adam. Now it works.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConditional Mean Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by