Clear Filters
Clear Filters

save fit data from ARX reports

1 view (last 30 days)
I have a lot of time series data (312 experiments) and several models. I want to make sure that the models outperform an AR model with the same number of parameters. However, due to the read-only mode of the AR report.fit, I have to fit each experiment separately because the Report.Fit struct is read-only. Is there any way I can extract the Sys.Report.Fit data so that I can save all 312 experiments using flist?

Accepted Answer

Garmit Pant
Garmit Pant on 17 Jun 2024
Hello Kiisa Nishikawa,
From the given description, I understand that, you are comparing multiple models against an AR model across 312 experiments and need a way to efficiently extract and save the read-only Report.Fit data from each experiment into a structured format (flist) for analysis.
To retrieve the Report.Fit data for each experiment, you will need to estimate the AR model using the arx function for each time series data.
You can then follow the following code snippet to extract and store the Report.Fit’ data for each experiment:
% Assuming 'FitResults' is the struct array to store results
flist = struct('ExperimentID', {}, 'FitReport', {});
for expID = 1:312
% Load or access your experiment data here
data = ...; % Your time series data for the current experiment
% Fit the AR model to your data
% Assuming 'order' is defined and 'data' is your time series data
model = arx(data, order);
% Extract the fit information
fitPercent = model.Report.Fit; % For example, to get the fit report
% Extract other metrics you're interested in...
% Save the extracted information to your struct array
flist(expID).ExperimentID = expID;
flist(expID).FitReport = fitReport;
% Save other metrics as needed...
end
  • The flist structure contains all fit data for AR models from each experiment.
  • flist is mutable, allowing for easy updates and manipulations.
  • Enables straightforward validation against other models.
  • Allows extraction of additional information, such as “OptionsUsed”.
  • Facilitates refinement of model estimations using extracted data.
For further understanding, I suggest you refer to the following MathWorks Documentation and resources:
  1. Refer to the "AR Model" example to understand how to estimate a time-series AR model using the arx function: https://www.mathworks.com/help/ident/ref/arx.html
  2. Refer to understand the different information about the results used for model estimation. Refer to the "Analyze and Refine Estimation Results Using Estimation Report" section of the second link given below to understand the above workflow: https://www.mathworks.com/help/ident/ug/estimation-report.html
I hope you find the above explanation and suggestions useful!
  2 Comments
Kiisa Nishikawa
Kiisa Nishikawa on 17 Jun 2024
Thanks for this answer! In the meantime, this is exactly what I ended up doing, which had the additional advantage that I could be sure I was using the exact same goodness of fit tests on all of the model results. I also received a helpful email from MAtlab support which showed how to make a struct and copy the fit data to it.
Garmit Pant
Garmit Pant on 17 Jun 2024
I am glad that you were able to complete your task!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!