Displaying 20 results from an estimated 361 matches for "y0".
2009 Jun 19
1
Drawing dendrogram
..., 0, 1), ncol=20, byrow=TRUE)
myclust<- hclust(dist(cor(x), method='euclidian'), method="ave")
mydend<-as.dendrogram(myclust)
par(mfrow=c(1,2), mar=c(5,4,4,3), oma=c(1, 3, 1, 3))
plot(mydend, xlim=c(4, -0.2), horiz = TRUE, main="My Dendrogram 1")
x0<- -0.35
y0<- 0.5
x1<- 1.8
y1<- 0.5
segments(x0, y0, x1, y1, col="red", lty=2)
x0<- -0.35
y0<- 4.4
x1<- 1.8
y1<- 4.4
segments(x0, y0, x1, y1, col="red", lty=2)
x0<- -0.35
y0<- 0.5
x1<- -0.35
y1<- 4.4
segments(x0, y0, x1, y1, col="red", lty=2)
x0...
2000 Nov 26
5
Another good optimization (for PPC only, though)
...airly accurate results (error below 1.0e-5 up to 100000.0 in 0.1 increments).
// In practice in Vorbis, it seems to do even better (the biggest error I saw was down in
// the 1e-10 range).
static inline float _fast_sqrt(float x)
{
const float half = 0.5;
const float one = 1.0;
float B, y0, y1;
// This'll NaN if it hits frsqrte
if (x == 0.0)
return x;
B = x;
#ifdef __GNUC__
asm("frsqrte %0,%1" : "=f" (y0) : "f" (B));
#else
y0 = __frsqrte(B);
#endif
/* First refinement step */
y1 = y0 + h...
2010 May 03
3
how to rewrite this for loops in matrix form without loop
x0=rnorm(100)
y0=rpois(100,3)+1
ind=as.data.frame(table(y0))
ind1=ind[,1]
ind2=ind[,2]
phi=NULL
for (i in 1:length(ind2)){
phi[i]=sum(x0[y0==ind1[i]])/ind2[i]
}
[[alternative HTML version deleted]]
2004 Feb 09
10
PhD student reading list, suggestions wanted
I've got a PhD student starting this year.
She'll be working on data mining.
She has asked for a reading list while she's still in her home
country, which is a really good sign.
Her cosupervisor and I don't (think we) have any problem with
choosing things that are specifically about data mining, but
there are some statistical ideas (sampling, exploratory-vs-confirmatory,
2002 Jun 17
3
Error bars.
There was an inquiry on this list recently about plotting some simple
error bars on a graph. Now Splus has a function (error.bar ---
originally written by Sue Clancy of DMS, CSIRO, I believe) to do this
job virtually at the touch of a key. (Well a few keys. :-) ) The
error.bar function is written completely in raw S --- no calls to
``.Internal'' or anything like that. So it would be
2010 Jun 18
4
Drawing sample from a circle
Hi, I would like to draw 10 uniformly distributed sample points from a circle with redius one and centered at (0,0). Is there any R function to do that?
Thanks,
[[alternative HTML version deleted]]
2012 Jul 29
1
Return od functions
Hi!
I have some questions about R function. I try to write a function for
multi-returns. The function code is as attachment.
dgp.par<-function(ai, bi, t, n)
{
t0<-t+20
y0<-matrix(0, nr=t0, nc=n)
y0[1,]<-ai/(1-bi)
for(tt in 2:t0)
{ y0[tt,]<-ai+bi*y0[tt-1,]+rnorm(n, 0, 1) }
y<-y0[21:t0,]
x<-y0[20:t0-1,]
z<-y0[19:t0-2,]
z<-z[2:t,]
dy<-y[2:t,]-y[1:t-1,]
dx<-x[2:t,]-x[1:t-1,]
return(y, x, z, dy, dx)
}
When I execute the function I wrote, it...
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
...fillOddEven = FALSE)
{
..debug.hatch <- FALSE
xy <- xy.coords(x, y)
if (is.numeric(density) && all(is.na(density) | density <
0))
density <- NULL
if (!is.null(angle) && !is.null(density)) {
polygon.onehatch <- function(x, y, x0, y0, xd, yd, ..debug.hatch =
FALSE,
...) {
if (..debug.hatch) {
points(x0, y0)
arrows(x0, y0, x0 + xd, y0 + yd)
}
halfplane <- as.integer(xd * (y - y0) - yd * (x -
x0) <= 0)
cross <- hal...
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
...fillOddEven = FALSE)
{
..debug.hatch <- FALSE
xy <- xy.coords(x, y)
if (is.numeric(density) && all(is.na(density) | density <
0))
density <- NULL
if (!is.null(angle) && !is.null(density)) {
polygon.onehatch <- function(x, y, x0, y0, xd, yd, ..debug.hatch =
FALSE,
...) {
if (..debug.hatch) {
points(x0, y0)
arrows(x0, y0, x0 + xd, y0 + yd)
}
halfplane <- as.integer(xd * (y - y0) - yd * (x -
x0) <= 0)
cross <- hal...
2008 Nov 17
2
re sults from "do.call" function
Dear R users...
I made this by help of one of R users.
_________________________________________________________________
X=matrix(seq(1,4), 2 , 2)
B=matrix(c(0.6,1.0,2.5,1.5) , 2 , 2)
func <- function(i,y0,j) { y0*exp(X[i,]%*%B[,j]) }
list1 <- expand.grid( i=c(1,2) , y0=c(1,2) , j=c(1,2) )
results <- do.call( func , list1 )
_________________________________________________________________
> results
[,1] [,2] [,3] [,4] [,5]
[,6]...
2017 Apr 26
3
Store unswitch
...t 9:36 PM, Davide Italiano <davide at freebsd.org> wrote:
> On Tue, Apr 25, 2017 at 9:24 PM, Hongbin Zheng via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Hi,
> >
> > Is there a pass in LLVM that can optimize:
> >
> > if (x)
> > a[i] = y0;
> > else
> > a[i] = y1;
> >
> > to
> >
> > a[i] = x ? y0 : y1?
> >
> > I tried opt (3.9) with -O3 but looks like such an optimization do not
> > happened.
> >
>
> The same IR at -O3 for both cases on this example.
> https://god...
2009 Oct 02
1
suggest enhancement to segments and arrows to facilitate horizontal and vertical segments
...gest a simple enhancement to segments() and arrows() to
facilitate drawing horizontal and vertical segments --
set default values for the second x and y arguments equal to the first set.
This is handy, especially when the expressions for coordinates are long.
Compare:
Segments:
< function (x0, y0, x1 = x0, y1 = y0, col = par("fg"), lty = par("lty"),
---
> function (x0, y0, x1, y1, col = par("fg"), lty = par("lty"),
Arrows:
< function (x0, y0, x1 = x0, y1 = y0, length = 0.25, angle = 30, code = 2,
---
> function (x0, y0, x1, y1, length = 0.25...
2008 Feb 16
1
Evaluate function on a grid
I have a function in R^2, say
f <- function(x,y) { ...skipped }
I want to plot this function using contour, persp. wireframe, etc. I know
that the function has a global
minimum at (x0, y0)
The naive approach is to evaluate the function on the outer product of two
arrays, like this:
sx <- c(seq(-3, x0, len = 100), seq(x0, 3, len = 100)[-1])
sy <- c(seq(-3, y0, len = 100), seq(y0, 3, len = 100)[-1])
fout <- outer( sx, sy, f)
persp(fout)
This works pretty well, but I would...
2010 Sep 08
6
'par mfrow' and not filling horizontally
...wn the way out of this one!
I've been round the documentation in ever-drecreasing
circles, and along other paths, without stumbling on
the answer.
The background to the question can be exemplified by
the example (no graphics window open to start with):
set.seed(54321)
X0 <- rnorm(50) ; Y0 <- rnorm(50)
par(mfrow=c(2,1),mfg=c(1,1),cex=0.5)
plot(X0,Y0,pch="+",col="blue",xlim=c(-3,3),ylim=c(-3,3),
xlab="X",ylab="Y",main="My Plot",asp=1)
par(mfg=c(2,1))
plot(X0,Y0,pch="+",col="blue",xlim=c(-3,3),ylim=c(-...
2009 Dec 01
2
Starting estimates for nls Exponential Fit
Hello everyone,
I have come across a bit of an odd problem: I am currently analysing data
PCR reaction data of which part is behaving exponential. I would like to fit
the exponential part to the following:
y0 + alpha * E^t
In which Y0 is the groundphase, alpha a fluorescence factor, E the
efficiency of the reaction & t is time (in cycles)
I can get this to work for most of my reactions, but part fails the nls fit
(Convergence failure: iteration limit reached without convergence). This
mainly has t...
2006 Dec 02
1
Trouble passing arrays to C code
Hello,
I'm having more trouble with interfacing with C code. I have a
function in C that will return the result of its computation as 3
arrays. The signature of the function is as follows:
void lorenz_run(double x0, double y0, double z0, double h, int steps,
double *res_x, double *res_y, double *res_z)
The function works, as I've tested it from within C itself and the
results it gives are accurate. In order to integrate it with R, I've
written the following C wrapper function:
void lorenz_run_R_wrappe...
2017 Jun 19
1
arrows: no vectors for "code" and "angle" parameters
...e and angle, or
2) returning an error or warning when user mistakenly supplies a
vector for those parameters? When code like this is wrapped into an
Sweaved document--we I don't see the graph on the screen--this error
is difficult to catch while proofreading.
Example:
x0 <- c(-1, -4, 4.5)
y0 <- c(-1, -4, -8)
x1 <- c(2, -2, -3)
y1 <- c(4, 4, 18)
mylengths <- c(0.2, 0.3, 0.15)
mycodes <- c(3, 2, 1)
myangle <- c(10, 60, 80)
plot(x = c(-5, 5), y = c(-10, 20),
type = "n", xlab = "", ylab = "")
arrows(x0 = x0, y0 = y0, x1 = x1, y1 = y1,...
2012 Apr 27
4
To make a graph for 4 functions
lets say I have these function and I want to have a graph on them
y0=x^2
y1=x^3
Then I say this
x=seq(0,10,length.out=100)
plot(x,y0,y1,type="l")
but R does not give me a graph. How would you do it?
--
View this message in context: http://r.789695.n4.nabble.com/To-make-a-graph-for-4-functions-tp4592941p4592941.html
Sent from the R help mailing list arc...
2011 Aug 08
3
on "do.call" function
...on.
Here is an simple example.
--------------------------------------------
> B <- matrix(c(.5,.1,.2,.3),2,2)
> B
[,1] [,2]
[1,] 0.5 0.2
[2,] 0.1 0.3
> x <- c(.1,.2)
> X <- cbind(1,x)
> X
x
[1,] 1 0.1
[2,] 1 0.2
>
> lt <- expand.grid(i=seq(1,2), y0=seq(0,2))
> lt
i y0
1 1 0
2 2 0
3 1 1
4 2 1
5 1 2
6 2 2
>
> fc <- function(y0,i) dpois(y0, exp(rowSums(t(X[i,])*B[,1])))
>
> do.call(fc,lt)
[1] 1.892179e-09 3.348160e-01 3.800543e-08 3.663470e-01 3.816797e-07
2.004237e-01
--------------------------------------------
Unfo...
2011 Aug 08
1
problem in do.call function
...n.
Here is an simple example.
--------------------------------------------
> B <- matrix(c(.5,.1,.2,.3),2,2)
> B
[,1] [,2]
[1,] 0.5 0.2
[2,] 0.1 0.3
> x <- c(.1,.2)
> X <- cbind(1,x)
> X
x
[1,] 1 0.1
[2,] 1 0.2
>
> lt <- expand.grid(i=seq(1,2), y0=seq(0,2))
> lt
i y0
1 1 0
2 2 0
3 1 1
4 2 1
5 1 2
6 2 2
>
> fc <- function(y0,i) dpois(y0, exp(rowSums(t(X[i,])*B[,1])))
>
> do.call(fc,lt)
[1] 1.892179e-09 3.348160e-01 3.800543e-08 3.663470e-01 3.816797e-07
2.004237e-01
--------------------------------------------
Un...