mirror of
https://github.com/MillironX/beefblup.git
synced 2025-01-03 04:32:08 -05:00
Fix solving the mized model equation
This commit is contained in:
parent
eb0ca76d19
commit
eb20b8b552
1 changed files with 4 additions and 4 deletions
|
@ -121,7 +121,7 @@ for i = 1:length(normal)
|
||||||
end
|
end
|
||||||
|
|
||||||
% Create an empty matrix for the additive relationship matrix
|
% Create an empty matrix for the additive relationship matrix
|
||||||
A = sparse(numanimals, numanimals);
|
A = zeros(numanimals, numanimals);
|
||||||
|
|
||||||
% Create lambdas to find sire and dam of each animal
|
% Create lambdas to find sire and dam of each animal
|
||||||
dam = @(id) [data{animalrow(num2str(id)), 3}];
|
dam = @(id) [data{animalrow(num2str(id)), 3}];
|
||||||
|
@ -166,13 +166,13 @@ for i = 1:numanimals
|
||||||
end
|
end
|
||||||
|
|
||||||
% Extract the observed data
|
% Extract the observed data
|
||||||
Y = data{:, 5};
|
Y = cell2mat(data(:, 5));
|
||||||
|
|
||||||
% The identity matrix for random effects
|
% The identity matrix for random effects
|
||||||
Z = speye(numanimals, numanimals);
|
Z = eye(numanimals, numanimals);
|
||||||
|
|
||||||
% Prompt for heritablity
|
% Prompt for heritablity
|
||||||
h2 = str2double(input('What is the heritablity for this trait? >> '));
|
h2 = input('What is the heritablity for this trait? >> ');
|
||||||
lambda = (1-h2)/h2;
|
lambda = (1-h2)/h2;
|
||||||
|
|
||||||
% Use the mixed-model equations
|
% Use the mixed-model equations
|
||||||
|
|
Loading…
Reference in a new issue