search for: bfunc

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

Did you mean: func
2007 Jul 06
2
How does the r-distribution function work
I am trying to understand what rbinom function does. Here is some sample code. Are both the invocations of bfunc effectively doing the same or I am missing the point? Thanks, Pieter bfunc <- function(n1,p1,sims) { c<-rbinom(sims,n1,p1) c } a=c() b=c() p1=.5 for (i in 1:10000){ a[i]=bfunc(30,p1,1) } b=bfunc(30,p1,10000)
2008 Oct 02
1
nls with plinear and function on RHS
...aluating the model" I deduce that it is failing in the numerical differentiation of x^Cd (but don't know why), so I thought I'd avoid the numerical differentiation by putting the RHS in a function to which I could (later) add a 'gradient' attribute # function to provide RHS bFunc <- function(x, Ca, Cb, Cc, Cd) cbind(Ca=1,Cb=x, Cc=x^Cd) # nls, plinear algorithm, RHS from function nls(y ~ bFunc(x, Ca, Cb, Cc, Cd), data=aDF, start=startL["Cd"], algorithm="plinear") However, this gives me "Error in nls(y ~ bFunc(x, Ca, Cb, Cc, Cd), data = aDF, sta...
2009 Feb 26
3
Moving Average
I am looking for some help at removing low-frequency components from a signal, through Moving Average on a sliding window. I understand thiis is a smoothing procedure that I never done in my life before .. sigh. I searched R archives and found "rollmean", "MovingAverages {TTR}", "SymmetricMA". None of the above mantioned functions seems to accept the smoothing
2008 Dec 16
8
sliding window over a large vector
Hi all, I have a very large binary vector, I wish to calculate the number of 1's over sliding windows. this is my very slow function slide<-function(seq,window){ n<-length(seq)-window tot<-c() tot[1]<-sum(seq[1:window]) for (i in 2:n) { tot[i]<- tot[i-1]-seq[i-1]+seq[i] } return(tot) } this works well for for reasonably sized vectors. Does