Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtuck committed Feb 8, 2024
1 parent 8b70ef3 commit 3a3e6ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/sample_shapes.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' Intelligence, IEEE Transactions on 33 (7), 1415-1428.
#' @export
#' @examples
#' out <- curve_karcher_mean(beta[, , 1, 1:2], maxit = 2, parallel=FALSE)
#' out <- curve_srvf_align(beta[, , 1, 1:5], maxit = 2, parallel=FALSE)
#' # note: use more shapes, small for speed
#' out.samples <- sample_shapes(out)
sample_shapes <- function(x, no=3, numSamp=10){
Expand Down Expand Up @@ -97,7 +97,7 @@ sample_shapes <- function(x, no=3, numSamp=10){
theta[i] = acos(x$rotmat[1,1,i])
}
mu_theta = mean(theta)
sd_theta = sd(theta)
sd_theta = stats::sd(theta)
R = array(0, dim=c(2,2,numSamp))
for (k in 1:numSamp){
theta = sample_vonmises(mu_theta, sd_theta)
Expand Down Expand Up @@ -134,8 +134,8 @@ sample_shapes <- function(x, no=3, numSamp=10){

sample_vonmises <- function(mu, sigma){
while (TRUE){
u1 = runif(1)
u2 = runif(1)
u1 = stats::runif(1)
u2 = stats::runif(1)
phi = 2 * pi * u1

R = exp((cos(phi-mu) - 1)/ sigma^2)
Expand Down
2 changes: 1 addition & 1 deletion man/sample_shapes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a3e6ee

Please sign in to comment.