# NOT RUN {
P = Pm(m = 5, nu = 0)
P
n = 10
t = 1:n
D = cbind(rep(1,n),t,t^2)
# Calculating in R
PR = D%*%solve(t(D)%*%D)%*%t(D)
# Using the provided function
P = Pm(m = n-1, nu = 1)
# Difference:
sum(abs(P-PR))
# }
Run the code above in your browser using DataLab