search for: nsam

Displaying 4 results from an estimated 4 matches for "nsam".

Did you mean: nasm
2012 Nov 07
5
Calling R object from R function
Hi, Can you please help me with this please? What I am trying to do is call a vector from R function and used in the new function So I create 4 functions with these arguments M11 <- function(TrainData,TestData,mdat,nsam) { ls <- list() I have few statments one of them is vectx <- c(,1,2,3,4,5,6,6) vectz <- c(12,34,5,6,78,9,90) and then................ ls(vectx=vtecx,vectz=vectz) return(ls) } Then I great an new function has the following arguments get.m <- function(dat,asim,ModelFun,M){ Sim <- li...
2008 Oct 04
3
How to plot countours with fixted densities?
Hello, I used the following codes to generate bivariate normal dependence structure with unit Frechet margins. Sigma <- matrix(c(1,.5*sqrt(1),.5*sqrt(1),1),2,2) # generate y <- mvrnorm(Nsam, c(0,0), Sigma) # random v <- cbind(pnorm(y[,1],mean = 0, sd = 1), pnorm(y[,2],mean = 0, sd = 1)) z <- cbind(-1/log(v[,1]),-1/log(v[,2])) z1 <- z[,1] z2 <- z[,2] And to get the scatter plot by: plot(z1,z2) How can I get the contour densities plots for (z1,z2) at 10^(-j/2)...
2002 Mar 25
2
Extreme value distributions (Long.)
...xtreme value distributions. I have observed a phenomenon which puzzles me, and I would appreciate it if anyone could shed some light on the puzzle. The phenomenon occurs in both R and Splus. (Also, I have now discovered, in stand-alone Fortran.) The phenomenon boils down to this: I generate ``nsam'' samples of chi-squared_1 iid random variables, each sample being of size ``n''. For each sample, let M be the maximum of the sample, and let the statistic S = (M - d_n)/2, where d_n = 2*ln(n) - ln(ln(n)) - ln(pi). Count the number K of times that G(S) < 0.05 where G(x)...
2003 Dec 05
3
.C() memory allocation
...the argument sequences = integer(0) in the call to .C(), then declaring the corresponding argument as int *sequences in my C code. I tried R_alloc()ing the storage in C and assigning the pointer to sequences but that segfaulted. Then I tried Realloc()ing sequences: sequences = Realloc(sequences, *nsam * *totalnmuts, int) ; But that also segfaults. Thanks very much for replies and R in general. Dan btw I think this is misleading / a typo in section 5.1.2 p.58 ch5 of "Writing R Extensions", I hope I haven't just misunderstood. It reads: The interface functions are type* Callo...