F<-c(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,1)
# Predictions of logarithmic percentiles
xi<-c(1.638,2.352,2.646,2.792,2.91,2.996,3.079,3.151,3.234,3.349,3.417,3.593)
# The variance of their prediction errors
D<-matrix(c(0.161652909,0.050118692,0.022268974,0.010707222,0.006888751,0,
0.000209963,-0.002739361,-0.005478838,-0.00655718,-0.006718843,-0.009819052,
0.050118692,0.074627668,0.03492943,0.01564454,0.008771398,0,
-0.002691651,-0.005102312,-0.007290366,-0.008136685,-0.00817717,-0.009026883,
0.022268974,0.03492943,0.029281808,0.014958206,0.009351904,0,
-0.002646641,-0.003949305,-0.00592412,-0.006556639,-0.006993025,-0.007742731,
0.010707222,0.01564454,0.014958206,0.014182608,0.009328299,0,
-0.001525745,-0.002448765,-0.003571811,-0.004470387,-0.004791053,-0.005410252,
0.006888751,0.008771398,0.009351904,0.009328299,0.009799233,0,
-0.000925308,-0.001331631,-0.002491679,-0.003277911,-0.003514961,-0.003663479,
rep(0,12),
0.000209963,-0.002691651,-0.002646641,-0.001525745,-0.000925308,0,
0.003186033,0.003014887,0.002961818,0.003112953,0.003050486,0.002810937,
-0.002739361,-0.005102312,-0.003949305,-0.002448765,-0.001331631,0,
0.003014887,0.00592428,0.005843888,0.005793879,0.005971638,0.006247869,
-0.005478838,-0.007290366,-0.00592412,-0.003571811,-0.002491679,0,
0.002961818,0.005843888,0.00868157,0.008348973,0.008368812,0.008633202,
-0.00655718,-0.008136685,-0.006556639,-0.004470387,-0.003277911,0,
0.003112953,0.005793879,0.008348973,0.011040791,0.010962609,0.010906917,
-0.006718843,-0.00817717,-0.006993025,-0.004791053,-0.003514961,0,
0.003050486,0.005971638,0.008368812,0.010962609,0.013546621,0.013753718,
-0.009819052,-0.009026883,-0.007742731,-0.005410252,-0.003663479,0,
0.002810937,0.006247869,0.008633202,0.010906917,0.013753718,0.02496596),ncol=12)
# observed tree data, 5 trees from 2 plots
obs<-data.frame(r=c(1,3,6,1,2),n=c(7,7,7,9,9),plot=c(1,1,1,2,2),d=c(10,11,27,8,12))
# See Example 11.33 in Mehtatalo and Lappi 2020b
qtrees<-qtree.varcov(obs,xi,F)
obs<-qtrees$obs
mustar<-obs$Ed
ystar<-log(obs$d)
R<-qtrees$R
Dtayd<-interpolate.D(D,obs$pEd)
Run the code above in your browser using DataLab