mx <- rnorm(5)
mx <- mx/sqrt( sum(mx^2) )
my <- rnorm(5)
my <- my/sqrt( sum(my^2) )
x <- rvmf(100, mx, 15)
A <- rotation(mx, my)
y <- x %*% t(A)
mod <- hspher.reg(y, x)
A
mod$A ## exact match, no noise
y <- x %*% t(A)
y <- y + rvmf(100, colMeans(y), 40)
mod <- hspher.reg(y, x)
A
mod$A ## noise added, more relistic example
Run the code above in your browser using DataLab