search for: pvec

Displaying 20 results from an estimated 61 matches for "pvec".

Did you mean: bvec
2005 May 03
1
maximization help :
Given a vector : pvec=(p1,p2,.... p J) with sum(pvec)=1, all the elements are non-negative, that is, they are probabilities a matrix A ( N* J ), with the elements alpha(ij) are 0 or 1 I want to MAXIMIZE THE RESULT RESULT= product( i=1, to N [ sum ( alpha(ij)* pj , j =1,to J ) ] ) th...
2011 Mar 19
2
problem running a function
...ture(c(3L,4L,3L,2L,1L), .Names = c("1", "2", "3", "4", > "5")) > > RN<-function(y=desman.y,J=5,nsites=39,Nmax=100){ + #### + lik<-function(parms){ + r<-expit(parms[1]) + lambda<-exp(parms[2]) + pvec<-1-(1-r)^(0:Nmax) + gN<-dpois(0:Nmax,lambda) + gN<-gN/sum(gN) + lik<-rep(NA,nsites) + for(i in 1:nsites){ + lik[i]<-sum(dbinom(y[i],J,pvec)*gN) + } + -1*sum(log(lik)) + } + #### + + tmp<-nlm(lik,c(0,0),...
2012 Oct 26
0
parallel::pvec FUN types differ when v is a list; code simplifications?
In pvec(list(1, 2), FUN, mc.cores=2) FUN sees integer() arguments whereas pvec(list(1, 2, 3), FUN, mc.cores=2) FUN sees list() arguments; the latter seems consistent with pvec's description. This came up in a complicated Bioconductor thread about generics and parallel evaluation https://stat.et...
2011 Jun 16
2
Bayesian Credible Intervals for a Proportion
...calculate Bayesian Credible Intervals for a proportion (disease prevalence values to be more specific) and am having trouble using R to do this. I am working with ncredint() function but have not had success with it. Please help! Example: Positive samples = 3 Total sampled = 10 Prevalence = 0.3 pvec <- seq(1,10,by=1) npost = dbinom(pvec,10,prob=0.3, log=FALSE) ncredint(pvec, npost, tol=0.01, verbose=FALSE) But I don't get the right Bayesian CI. What am I doing wrong? Thanks! Tina -- View this message in context: http://r.789695.n4.nabble.com/Bayesian-Credible-Intervals-for-a-Proporti...
2016 Mar 14
2
[PATCH v1 01/19] mm: use put_page to free page instead of putback_lru_page
...put_page is aware of > LRU list so if it releases last refcount of the page, it removes > the page from LRU list. However, It makes unnecessary operations > (e.g., lru_cache_add, pagevec and flags operations. Yeah, and compaction (perhaps also other migration users) has to drain the lru pvec... Getting rid of this stuff is worth even by itself. > It would be > not significant but no worth to do) and harder to support new > non-lru page migration because put_page isn't aware of non-lru > page's data structure. > > To solve the problem, we can add new hook in p...
2016 Mar 14
2
[PATCH v1 01/19] mm: use put_page to free page instead of putback_lru_page
...put_page is aware of > LRU list so if it releases last refcount of the page, it removes > the page from LRU list. However, It makes unnecessary operations > (e.g., lru_cache_add, pagevec and flags operations. Yeah, and compaction (perhaps also other migration users) has to drain the lru pvec... Getting rid of this stuff is worth even by itself. > It would be > not significant but no worth to do) and harder to support new > non-lru page migration because put_page isn't aware of non-lru > page's data structure. > > To solve the problem, we can add new hook in p...
2020 Jan 10
2
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
...environment variable make sense? I've prototyped a working patch that works like: > options(fork.allowed = FALSE) > unlist(parallel::mclapply(1:2, FUN = function(x) Sys.getpid())) [1] 14058 14058 > parallel::mcmapply(1:2, FUN = function(x) Sys.getpid()) [1] 14058 14058 > parallel::pvec(1:2, FUN = function(x) Sys.getpid() + x/10) [1] 14058.1 14058.2 > f <- parallel::mcparallel(Sys.getpid()) Error in allowFork(assert = TRUE) : Forked processing is not allowed per option ?fork.allowed? or environment variable ?R_FORK_ALLOWED? > cl <- parallel::makeForkCluster(1L) Error...
2011 Apr 09
1
loop and sapply problem, help need
Dear R experts Sorry for this question M1 <- 1:10 lcd1 <- c(11, 22, 33, 44, 11, 22, 33, 33, 22, 11) lcd2 <- c(22, 11, 44, 11, 33, 11, 22, 22, 11, 22) lcd3 <- c(12, 12, 34, 14, 13, 12, 23, 23, 12, 12) #generating variables through sampling pvec <- c("PR1", "PR2", "PR3", "PR4", "PR5", "PR6", "PR7", "PR8", "PR9", "PR10") fun11 <- function(x){ smpool <- c(1,2,3,3) x <- sample(smpool, 10, replace= TRUE) } newd <- sapply...
2005 May 02
0
help : Bisect( )
I am using the package of Icens but for the function Bisect I do not know what ndir is it just says the direction of pvec, but what kind of values should I use ? thanks for reply pls give me an example.. Bisect(tA, pvec, ndir, Meps, tolbis=1e-07) Arguments: tA: The transpose of the clique matrix. pvec: The current estimate of the probability vector. ndir: The direction to explore. Mep...
2004 Apr 30
1
Exact Binomial test feature or bug?
...t; 0) && (conf.level < 1))) stop("conf.level must be a single number between 0 and 1") DNAME <- paste(deparse(substitute(x)), "and", deparse(substitute(n))) PVAL <- switch(alternative, less = pbinom(x, n, p), greater = 1 - pbinom(x - 1, n, p), { pvec <- pbinom(0:n, n, p) if(x/n < p) { pb <- pbinom(x, n, p) p2 <- max((1 - pvec) [pb - (1 - pvec) >= - eps * pb], 0) min(1, pb + p2) } else { pb <- (1 - pbinom(x - 1, n, p)) p2 <- max(pvec[pb - pvec >= - eps * pb], 0) min(1, pb + p2) }...
2003 Nov 25
2
Lambert's W function
Hello List does anyone have an R function for the Lambert W function? I need complex arguments. [the Lamert W function W(z) satisfies W(z)*exp(W(z)) = z but I could'nt even figure out how to use uniroot() for complex z] -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre SO14 3ZH tel +44(0)23-8059-7743 initialDOTsurname at soc.soton.ac.uk (edit in obvious way; spam
2020 Jan 10
2
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
...rking patch that >> works like: >>> options(fork.allowed = FALSE) >>> unlist(parallel::mclapply(1:2, FUN = function(x) Sys.getpid())) >> [1] 14058 14058 >>> parallel::mcmapply(1:2, FUN = function(x) Sys.getpid()) >> [1] 14058 14058 >>> parallel::pvec(1:2, FUN = function(x) Sys.getpid() + x/10) >> [1] 14058.1 14058.2 >>> f <- parallel::mcparallel(Sys.getpid()) >> Error in allowFork(assert = TRUE) : >> Forked processing is not allowed per option ?fork.allowed? or >> environment variable ?R_FORK_ALLOWED? >&g...
2016 Apr 10
0
what is the faster way to search for a pattern in a few million entries data frame ?
...e(res0 <- startsWith(grams, "900001")) user system elapsed 0.658 0.012 0.669 which returns the same result as grepl > identical(res0, res1 <- grepl("^900001", grams)) [1] TRUE One can also parallelize the already vectorized grepl function with parallel::pvec, with some opportunity for gain (compared to grepl) on non-Windows > system.time(res2 <- pvec(seq_along(grams), function(i) grepl("^900001", grams[i]), mc.cores=8)) user system elapsed 24.996 1.709 3.974 > identical(res0, res2) [[1]] TRUE I think anything else wo...
2006 Nov 02
3
Better y-axis labels, and x-axis scaling
Hello I'm plotting some data using matplot with a logarithmic scale on the y-axis. This is the call to matplot I'm using: matplot(turns, distances, type = "l", log = "y", lty = "solid", ylab = "", xlab = "Time steps", col = c("black")) The values for the 'distances' vector are always between 0 and 1. The
2016 Mar 15
0
[PATCH v1 01/19] mm: use put_page to free page instead of putback_lru_page
...>LRU list so if it releases last refcount of the page, it removes > >the page from LRU list. However, It makes unnecessary operations > >(e.g., lru_cache_add, pagevec and flags operations. > > Yeah, and compaction (perhaps also other migration users) has to > drain the lru pvec... Getting rid of this stuff is worth even by > itself. Good note. Although we cannot remove lru pvec draining completely, at least, this patch removes a case which should drain pvec for returning freed page to buddy. Thanks for the notice. > > >It would be > >not significant...
2011 Aug 28
2
-log10 of 0
Dear R users: Sorry for this simple question: I am writing a function where I would need to pickup p values and make -log10 of it. The p values are from an anova output and sometime it can yield me 0. -log10 (0) [1] Inf I can not replace Inf with 0, which not case here. This is restricting me to go further in the function and out me the error. You help is highly appreciated. Thanks; --
2020 Jan 10
0
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
...'ve prototyped a working patch that > works like: > >> options(fork.allowed = FALSE) >> unlist(parallel::mclapply(1:2, FUN = function(x) Sys.getpid())) > [1] 14058 14058 >> parallel::mcmapply(1:2, FUN = function(x) Sys.getpid()) > [1] 14058 14058 >> parallel::pvec(1:2, FUN = function(x) Sys.getpid() + x/10) > [1] 14058.1 14058.2 >> f <- parallel::mcparallel(Sys.getpid()) > Error in allowFork(assert = TRUE) : > Forked processing is not allowed per option ?fork.allowed? or > environment variable ?R_FORK_ALLOWED? >> cl <- parall...
2020 Jan 10
6
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
...t;>> options(fork.allowed = FALSE) >>>>> unlist(parallel::mclapply(1:2, FUN = function(x) Sys.getpid())) >>>> [1] 14058 14058 >>>>> parallel::mcmapply(1:2, FUN = function(x) Sys.getpid()) >>>> [1] 14058 14058 >>>>> parallel::pvec(1:2, FUN = function(x) Sys.getpid() + x/10) >>>> [1] 14058.1 14058.2 >>>>> f <- parallel::mcparallel(Sys.getpid()) >>>> Error in allowFork(assert = TRUE) : >>>> Forked processing is not allowed per option ?fork.allowed? or >>>> envir...
2019 Apr 15
2
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
On Mon, 15 Apr 2019 at 08:44, Tomas Kalibera <tomas.kalibera at gmail.com> wrote: > > On 4/13/19 12:05 PM, I?aki Ucar wrote: > > On Sat, 13 Apr 2019 at 03:51, Kevin Ushey <kevinushey at gmail.com> wrote: > >> I think it's worth saying that mclapply() works as documented > > Mostly, yes. But it says nothing about fork's copy-on-write and memory >
2020 Jan 11
1
SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()
...>>>>>>> unlist(parallel::mclapply(1:2, FUN = function(x) Sys.getpid())) >>>>>> [1] 14058 14058 >>>>>>> parallel::mcmapply(1:2, FUN = function(x) Sys.getpid()) >>>>>> [1] 14058 14058 >>>>>>> parallel::pvec(1:2, FUN = function(x) Sys.getpid() + x/10) >>>>>> [1] 14058.1 14058.2 >>>>>>> f <- parallel::mcparallel(Sys.getpid()) >>>>>> Error in allowFork(assert = TRUE) : >>>>>> Forked processing is not allowed per option ?fork.al...