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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!