Open in the MATLAB editor: g02ld_example
function g02ld_example fprintf('g02ld example results\n\n'); n = 15; z = zeros(n,n); z(:,1:8) = ... [-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -2.6931, -2.5271, -1.2871, 2.8369, 1.4092, -3.1398, 0.0744, -1.7333; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.7548, 3.6521; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.4064, 1.7438; -2.6931, -2.5271, -1.2871, 0.0744, -1.7333, 0.0902, 0.0744, -1.7333; 2.2261, -5.3648, 0.3049, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -4.1921, -1.0285, -0.9801, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -4.9217, 1.2977, 0.4473, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.2261, -5.3648; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.9217, 1.2977; -2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.1921, -1.0285]; z(:,9:n) = ... [ 0.5746, 1.9607, -1.6324, 0.5740, 2.8369, 1.4092, -3.1398; 0.5746, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 1.9607, -1.6324, 0.5746, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.8524, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, -1.2201, 0.8829, 2.2253; 1.1057, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; 0.3049, 2.2261, -5.3648, 0.3049, 2.8369, 1.4092, -3.1398; 0.4473, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398; -0.9801, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398]; % Means and scalings orig = int64(-1); xbar = [-2.6137; -2.3614; -1.0449; 2.8614; 0.3156; -0.2641; -0.3146; -1.1221; 0.2401; 0.4694; -1.9619; 0.1691; 2.5664; 1.3741; -2.7821]; ybar = [0.452]; iscale = int64(1); xstd = [ 1.4956; 1.3233; 0.5829; 0.7735; 0.6247; 0.7966; 2.4113; 2.0421; 0.4678; 0.8197; 0.9420; 0.1735; 1.0475; 0.1359; 1.3853]; ystd = [0.9062]; b = [-0.1383; 0.0572; -0.1906; 0.1238; 0.0591; 0.0936; -0.2842; 0.4713; 0.2661; -0.0914; 0.1226; -0.0488; 0.0332; 0.0332; -0.0332]; isz = ones(n, 1, 'int64'); % Calculate predictions [yhat, ifail] = g02ld( ... orig, xbar, ybar, iscale, xstd, ystd, b, isz, z); % Display results disp('Predicted values'); disp(yhat);
g02ld example results Predicted values 0.2132 0.5152 0.1437 0.4459 0.1716 2.4809 0.0964 1.4475 -0.1546 -0.5492 0.5393 0.2686 -1.1332 1.7975 0.4973