Information Technology Reference
In-Depth Information
V <- X.scaled.svd$v[,1:2]/lambda
# setup of plotting region
limx <- c(min(V[,1], USigma[,1]), max(V[,1], USigma[,1])) + shift
limy <- c(min(V[,2], USigma[,2]), max(V[,2], USigma[,2]))
plot(rbind(USigma, V), asp = 1, xlim = limx*exp.factor, ylim =
limy*exp.factor, type = "n", xlab = "", ylab = "", xaxt = "n",
yaxt = "n", xaxs = "i", yaxs = "i", main = "")
points(x = 0, y = 0, pch = "O", cex = 2, col = "green")
# plot row co-ordinate
points(x = USigma[11,1], y = USigma[11,2], pch = 15)
text(x = USigma[11,1], y = USigma[11,2], label = "11", pos = 1,
cex = 0.70)
# plot axis for column 'y'
eq.line <- Draw.line2(x = c(0,V[1,1]), y = c(0,V[1,2]))
# plot column marker
arrows(x0 = 0, y0 = 0, x1 = V[1,1], y1 = V[1,2], col = "red",
lwd = 2, length = 0.15)
# plot row marker
arrows(x0 = 0, y0 = 0, x1 = USigma[11,1], y1 = USigma[11,2],
col = "red", lty = 2, lwd = 1.85, length = 0.1)
# obtain 'nice' markers
markers.x <- pretty(range(X[,1]), n = n.int)
# ensure O toward middle of figure
if(add[2]>0)
for(i in 1:add[2])
markers.x <- c(markers.x, markers.x[length(markers.x)]+
markers.x[length(markers.x)]-markers.x[length(markers.x)-1])
if(add[1]>0)
for(i in 1:add[1])
markers.x <- c(markers.x[1] - (markers.x[2] - markers.x[1]),
markers.x)
markers.v <- (markers.x - col.means[1])/sds[1]
# apply eq (2.10)
calibrations.x <- (markers.v / sum(V[1,1:2]^2)) * V[1,1]
calibrations.y <- (markers.v / sum(V[1,1:2]^2)) * V[1,2]
points(x = calibrations.x, y = calibrations.y, pch = 16,
cex = 0.65)
text(x = calibrations.x, y = calibrations.y, label = markers.x,
pos = 4, cex = 0.70)
# calcuate 1sd marker
marker.sd.x <- sds[1] + col.means[1]
marker.sd.v <- (marker.sd.x - col.means[1])/sds[1]
calibrations.sd.x <- (marker.sd.v / sum(V[1,1:2]^2)) * V[1,1]
calibrations.sd.y <- (marker.sd.v / sum(V[1,1:2]^2)) * V[1,2]
points(x = calibrations.sd.x, y = calibrations.sd.y, pch = 16,
cex = 0.65)
text(x = calibrations.sd.x, y = calibrations.sd.y, label = "1sd",
pos = 4, cex = 0.70, col = "green")
# orthogonal to projection of point 11 on axis y
abline(a = UDelta[11,2] + 1/eq.line$gradient*UDelta[11,1],
b = -1/eq.line$gradient, col = "blue", lty = 2)
}
Search WWH ::




Custom Search