search for: rvonmises

Displaying 5 results from an estimated 5 matches for "rvonmises".

Did you mean: vonmises
2012 Feb 10
4
function arrows.circular not working
I have started using the circular package but it is not recognizing the function arrows.circular. I attempted to use the example provided in the circular manual. Here is the example code using the circular package: plot(rvonmises(10, circular(0), kappa=1)) arrows.circular(rvonmises(10, circular(0), kappa=1)) arrows.circular(rvonmises(10, circular(0), kappa=1), y=runif(10), col=2) arrows.circular(rvonmises(10, circular(0), kappa=1), y=runif(10), x0=runif(10, -1, 1), y0=runif(10, -1, 1), col=3) My error is: Error:...
2009 Apr 12
2
"taking the log then later exponentiate the result" query
...taking the log of M and then the exponential of the result, but I clearly must be doing something wrong. I keep getting the error message: Error in if (U <= ratio/exp(M)) { : missing value where TRUE/FALSE needed Any ideas how I go about correctly taking the log and then the exponential? rvonmises.norm <- function(n,alpha,beta) { out <- rep(0,n) counter <- 0 total.sim <- 0 p<-alpha/(alpha+beta) M <-log((((alpha-1)^(alpha-1))*((beta-1)^(beta-1)))/((beta+alpha-2)^(alpha+beta-2))) while(counter < n) { total.sim <- total.sim+1 proposal <- runif(1) if(proposal >= 0 &...
2009 Apr 12
0
Generalised Rejection Sampling
...the log of M and then the exponential of the result, but I clearly must be doing something wrong. I keep getting the error message: Error in if (U <= ratio/exp(M)) { : missing value where TRUE/FALSE needed Any ideas how I go about correctly taking the log and then the exponential? rvonmises.norm <- function(n,alpha,beta) { out <- rep(0,n) counter <- 0 total.sim <- 0 p<-alpha/(alpha+beta) M <-log((((alpha-1)^(alpha-1))*((beta-1)^(beta-1)))/((beta+alpha-2)^(alpha+beta-2))) while(counter < n) { total.sim <- total.sim+1 proposal <- runif(1) if(proposal >= 0 &...
2005 May 15
1
CircStats and Anova
Hi, If I have two sets of directional data (in radians) and want to compare them with a multifactorial anova. Is it even legitimate to compare circular data with an anova? The books I've picked up from the library don't really say, but it looks unlikely. If it is allowable, is my having stored the data as circular (X = as.circular(A)) something the aov() function will take into account,
2007 Sep 22
0
error messages
...grals both in the denominator and in the numerator of the density function. It looks like the outcome depends on the initial values given. My program is shown below: library(circular) ######################################## 4 parameters ######################################## z<-rvonmises(100,0,1) z<-as.vector(z) x<-rvonmises(100,0,2+cos(z)) x<-as.vector(x) f<-function(x){ k1<-x[1] k2<-x[2] k12<-x[3] g<-x[4] -2*sum(log( exp(k1*cos(x))*integrate(function(y)exp((k2+k12*cos(x))*cos(y)),g,2*pi,subdivisions=1000000)$value /(2*pi*integrate(fun...