how to get aic from gapfill function?

2 visualizaciones (últimos 30 días)
Peter Mills
Peter Mills el 2 de Jul. de 2018
Editada: Peter Mills el 2 de Jul. de 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;
end
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.
order=1:4001;
MAEmetric=length(order);
RMSEmetric=length(order);
for i=1:4001
lb = fillgaps(mt,4001,order(i));
MAEmetric(i)=mae(mtlb,lb);
RMSEmetric(i)=rmse(mtlb,lb);
end
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);
r=sqrt(sum((data(:)-estimate(:)).^2)/numel(data));

Respuestas (0)

Categorías

Más información sobre Monte-Carlo en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by