Displaying 20 results from an estimated 1400 matches similar to: "interfacing C into R and R packages"
2007 May 09
2
pvmnorm, error message
Hello there!
My operating system is Windows XP, my version of R is the latest (R-2.5.0). Recently I have downloaded the package "mvtnorm" and a problem with the command "pmvnorm" occured. Trying to enter the lines ...
A <- diag(3)
A[1,2] <-0.5
A[1,3] <- 0.25
A[2,3] <- 0.5
pvmnorm(lower=c(-Inf,-Inf,-Inf), upper=c(2,2,2),mean = c(0,0,0), corr=A)
I got the following
2003 Jun 30
4
french map
Hello,
I would like to know if (as the usa map with Splus), it is possible with
R to plot the french map and to add points (representing towns for
instance) on the figure in the appropriate (x,y) system.
Thank you.
Nathalie Peyrard
2004 Jul 28
2
problem with the .Rhistory
Hello,
The history function doesn't seems to work when I am working with R.
I have a .Rhistory file in my working directory and I have tried
savehistory(file = ".Rhistory")
or the command given in the history help :
.Last <- function()
if(interactive()) try(savehistory(".Rhistory"))
and I get the same error message
Error in
2007 Jul 23
2
persp and greek symbols in the axes labels
Hello,
I am plotting a 3D function using persp and I would like to use greek
symbols in the axes labels.
I have found examples like this one on the web:
plot(0,0,xlab=expression(kappa[lambda]),ylab=substitute(paste(phi,"=",true,sigma),list(true=5)))
this works well with plot but not with persp:
with the command
persp(M,theta = -20,phi =
2000 Nov 14
1
mvtnorm
Announcement: mvtnorm
Multivariate Normal and T Distribution
mvtnorm implements two R functions for the computation of the multivariate t
and normal distribution:
pmvt: Computes the the distribution function of the multivariate t
distribution for arbitary limits, degrees of freedom and
correlation matrices based on algorithms by Genz and Bretz.
pmvnorm: Computes the distribution
2000 Nov 14
1
mvtnorm
Announcement: mvtnorm
Multivariate Normal and T Distribution
mvtnorm implements two R functions for the computation of the multivariate t
and normal distribution:
pmvt: Computes the the distribution function of the multivariate t
distribution for arbitary limits, degrees of freedom and
correlation matrices based on algorithms by Genz and Bretz.
pmvnorm: Computes the distribution
2004 Sep 04
5
R question
Hi,
Would you help me solve the following question? Thanks.
Question: If I try to set the probability=0.05 and find the approximate x. (The answer should be somewhere between 2.1782 and 2.1783.)
I write about this R program as follows but I don¡¦t know how to get the value of x which is between 2.1782 and 2.1783.
library(mvtnorm)
value<-array(1000)
a<-array(1000)
2017 Oct 02
0
Issues with 'Miwa' algorithm in mvtnorm package
Good point. Now this returns 0.04062184. Hmmm.....
On Mon, Oct 2, 2017 at 6:30 PM, Hollie Johnson (PGR) <
h.a.johnson at newcastle.ac.uk> wrote:
> Hi Eric,
>
>
> Thanks for having a look into this. I think you have a small typo...
>
> B <- matrix(x, nrow=3, byrow = TRUE) should read B <- matrix(y, nrow=3,
> byrow = TRUE)
>
>
> Regards, Hollie
>
2017 Oct 02
5
Issues with 'Miwa' algorithm in mvtnorm package
Currently doing some work on local maxima on a random field and have encountered an issue with the Miwa algorithm used with the pmvnorm function in the mvtnorm R package.
Based on recommendations by Mi et al., we ran the mvtnorm package using the Miwa algorithm, since we have a maximum of 4 dimensions with non-singular matrices. However, running the estimation procedure in this way, we obtained
2009 Apr 19
1
help with this code
Hi, can anyone help me with the following code? Thanks!
library(mvtnorm)
f2 <- function(n, rho) {
var <- matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T)
beta <- seq(0, 1, length.out=n+1)
alpha <- sort (sapply(1-beta, qnorm))
x <- array(0, dim=c(n, n))
for (s in 1:n) {
for (t in 1:n){
if (s>=t)
x[s,t] <- pmvnorm(lower=c(alpha[s],
2017 Oct 02
0
Issues with 'Miwa' algorithm in mvtnorm package
Rather specialized.
As this appears to be primarily a statistical, not an R programming
question, you may do better posting on a statistical site like
http://stats.stackexchange.com/ if you don't get a satisfactory reply here
. Alternativey, if you think this is a package bug, perhaps contact the
package maintainer directly, as (s)he may not monitor this list.
-- Bert
Bert Gunter
2005 May 14
1
pmvnorm
Hi there,
pmvnorm(lo=c(-Inf,-Inf), up=c(Inf,Inf), mean=c(0,0) )
should give me "1", right? But it doens't - it giver me "0".
Would someone help me, please?
[[alternative HTML version deleted]]
2010 Jun 18
1
question in R
Dear all,
I am trying to calculate certain critical values from bivariate normal
distribution (please see the
function below).
m <- 10
rho <- 0.1
k <- 2
alpha <- 0.05
## calculate critical constants
cc_z <- numeric(m)
var <- matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T)
for (i in 1:m){
if (i <= k) {cc_z[i] <- qmvnorm((k*(k-1))/(m*(m-1))*alpha,
2007 Jul 07
2
No convergence using ADAPT
I am trying calculate a probability using numerical integration. The first
program I ran spit out an answer in a very short time. The program is below:
## START PROGRAM
trial <- function(input)
{
pmvnorm(lower = c(0,0), upper = c(2, 2), mean = input, sigma = matrix(c(.1, 0,
0, .1), nrow = 2, ncol = 2, byrow = FALSE))
}
require(mvtnorm)
require(adapt)
bottomB <- -5*sqrt(.1)
topB <-
2006 Sep 30
1
error from pmvnorm
Hi all,
Can anyone tell me what the following error message means?
" Error in mvt(lower = lower, upper = upper, df = 0, corr = corr, delta = mean,
: NA/NaN/Inf in foreign function call (arg 6)"
It was generated when I used the 'pmvnorm' function in the 'mvtnorm' package.
Thanks a lot.
Yonghai Li
2007 Jul 30
1
correlation and matrix
Dear everyone,
I am new in R and I've got difficulties in realizing the following
tasks:
-I have variables (factors) with different numbers of levels, either 1,
2 or 3.
-I have a matrix containing these 204 factors and I have to correlate
them by groups of 4 variables.
-I have to delete the factors just having one level ( because when
correlating one-level factors, the output is NA)
here
2012 Apr 19
3
Bivariate normal integral
hello,
I'm trying to improve the speed of my calculation but didn't get to a
satisfying result.
It's about the numerical Integration of a bivariate normal distribution.
The code I'm currently using
x <-
qnorm(seq(.Machine$double.xmin,c(1-2*.Machine$double.eps),by=0.01),
mean=0,sd=1)
rho <- 0.5
integral <- function(rho,x1){
2005 Sep 28
1
R-code for binormla distribution
Dear users,
does any one have a code (S or R) to compute the binormal distribution
(or the upper its quadrant area) other than the pmvnorm.
Thanks
--
Nabil Channouf
etudiant en Ph.D.
Bureau 3733
Departement d'Informatique et de Recherche Operationnelle (D.I.R.O.)
Universite de Montreal, C.P. 6128, succ. Centre-Ville, Montreal, H3C 3J7
Tel.: (514) 343-6111, poste 1796 Fax.: (514) 343-5834
2009 Nov 20
2
Problem with Numerical derivatives (numDeriv) and mvtnorm
I'm trying to obtain numerical derivative of a probability computed
with mvtnorm with respect to its parameters using grad() and
jacobian() from NumDeriv.
To simplify the matter, here is an example:
PP1 <- function(p){
thetac <- p
thetae <- 0.323340333
thetab <- -0.280970036
thetao <- 0.770768082
ssigma <- diag(4)
ssigma[1,2] <- 0.229502120
2008 Oct 01
2
Bivariate normal
Package mvtnorm provides dmvnorm, pmvnorm that can be used to compute
Pr(X=x,Y=y) and Pr(X<x,Y<y) for a bivariate normal.
Are there functions that would compute Pr(X<x,Y=y)?
I'm currently using "integrate" with dmvnorm but it is too slow.