How to do stepwise knots selection based on AIC/BIC criteria in Linear mixed effect model?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Gautam Pendse
2018-2-6
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Thermodynamics & Statistical Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!