How to do stepwise knots selection based on AIC/BIC criteria in Linear mixed effect model?
2 ビュー (過去 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!