data(lavoranti.eucalyptus)
# Arciniegas-Alarcon et al use SVD and regression to estimate missing values.
# Partition the matrix X as a missing value xm, row vector xr1, column
# vector xc1, and submatrix X11
# X = [ xm xr1 ]
# [ xc1 X11 ] and let X11 = UDV'.
# Estimate the missing value xm = xr1 V D^{-1} U' xc1
dat <- lavoranti.eucalyptus
dat <- droplevels(subset(dat, origin=="Ravenshoe"))
dat <- acast(dat, gen~loc, value.var="height")
dat[1,1] <- NA
x11 <- dat[-1,][,-1]
X11.svd <- svd(x11)
xc1 <- dat[-1,][,1]
xr1 <- dat[,-1][1,]
xm <- xr1xm # = 18.29, Original value was 17.4Run the code above in your browser using DataLab