How to do stepwise knots selection based on AIC/BIC criteria in Linear mixed effect model?

1 visualización (últimos 30 días)
HI I intend to choos knots of spline basis function in matlab based on some matmethically rigid way. So can anyone tell me how to do stepwise knots selections based on modelc selection criteria (AIC/BIS/CV)? I am putting a sample codes below.
x=1:50;y=randn(1,50);G=1:5;
X = [ones(1665,1),x];
num_knots=length(x);
knots=(quantile(unique(x),linspace(0,1,(num_knots+2))));
d=4 ;
t=[zeros(1,d) knots repelem(max(x),d)];
range=[min(x) max(x)];
z=bspline_basismatrix(d,t,x);
Z=[ones(1665,1) z];
lme = fitlmematrix(X,y,Z,[],'CovariancePattern','Isotropic','FitMethod','REML','FixedEffectPredictors',....
{'Intercept','Time'});
For now I just took a random selection of knots. Any help would be appriciated.

Respuestas (1)

Gautam Pendse
Gautam Pendse el 6 de Feb. de 2018
Hi Mithun,
You can access model criteria for a LME model via the ModelCriterion property. Candidate models can be compared using a criterion such as AIC (lower is better).
Hope that helps,
Gautam

Community Treasure Hunt

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

Start Hunting!

Translated by