how to get aic from gapfill function?

1 view (last 30 days)
Peter Mills
Peter Mills on 2 Jul 2018
Edited: Peter Mills on 2 Jul 2018
How do I get the values of aic for MATLAB gapfill function?
load mtlb
gn = 3;
mt = mtlb;
gl = randi([300 600],gn,1);
for kj = 1:gn
mt(kj*1000+randi(100)+(1:gl(kj))) = NaN;
lb = fillgaps(mt,4001,'aic');
How do I get the aic values that were used to optimize for model as outputs? How do I get the mae and rmse of the accuracy of each prediction of missing values?
I have tried a for loop of model order but it works out very slow.
for i=1:4001
lb = fillgaps(mt,4001,order(i));
The following function is required for rmse
function r=rmse(data,estimate)
% Function to calculate root mean square error from a data vector or matrix
% and the corresponding estimates.
% Usage: r=rmse(data,estimate)
% Note: data and estimates have to be of same size
% Example: r=rmse(randn(100,100),randn(100,100));
% delete records with NaNs in both datasets first
I = ~isnan(data) & ~isnan(estimate);
data = data(I); estimate = estimate(I);

Answers (0)


Community Treasure Hunt

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

Start Hunting!