Displaying 20 results from an estimated 10000 matches similar to: "guidelines for consistency of vector functions"
2012 Feb 09
1
Constraint on one of parameters.
Dear all,
I have a function to optimize for a set of parameters and want to set a
constraint on only one parameter. Here is my function. What I want to do is
estimate the parameters of a bivariate normal distribution where the
correlation has to be between -1 and 1. Would you please advise how to
revise it?
ex=function(s,prob,theta1,theta,xa,xb,xc,xd,t,delta) {
expo1=
2020 Feb 09
2
[RFC PATCH] Add SHA1 support
From: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
This is a huge all-in-one patch and deserves a little cleanup and
splitting. However, I wanted to get it out here for some feedback.
My primar motivation to use SHA1 for checksumming (by default) instead
of MD5 is not the additional security bits but performance. On a decent
x86 box the SHA1 performance is almost the same as
2011 Aug 15
2
plotting segments only and in color
Hello,
I've a question concerning the display of interval data.
A sample dataset where X is an interval between Xa and Xb
which should be displayed:
Y=c(15,14,23,18,19,9,19,13)
Xa=c(17,22,21,18,19,25,8,19)
Xb=c(22,22,29,34,19,26,17,22)
X = (Xa+Xb)/2
It's easily possible to plot the mean of the interval like:
plot(X,Y)
afterwards I can create lines for the interval with:
2017 May 30
2
Pseudo-instruction that overwrites its input register
On Tue, 30 May 2017, Nemanja Ivanovic wrote:
> This is typically accomplished with something like PPC's `RegConstraint` and
> `NoEncode`. You can see examples of it that are very similar to what you're after in
> PPC's load/store with update forms (i.e. load a value and update the base register
> with the effective address - these are used for pre-increment loads/stores).
2009 Nov 25
1
group generics
I have classes A and B, where B contains A. In the implementation of
the group generic for B I would like to use the corresponding group
generic for A. Is there a way to do that?
I would also appreciate any comments if what I'm trying to do seems like
the wrong approach.
Here's a stripped down example:
setClass("A",
2005 Jun 13
1
crosshair in scatterplot to mark special points
In a plot on an X11 device, I'd like to mark a few points with
a large thin "crosshairs". By "mark" I mean: draw the crosshair
on the plot.
The two unsatisfactory methods that I have are:
METHOD 1:
points( x, y, pch="+" ,cex=2)
METHOD 2:
line(xa, xb, y0, y0)
line(x0, x0, ya, yb)
Method #1 produces a crosshair with fat lines. It is not possible
2011 Apr 07
0
classification
Dear all, this is not a pure R question, but really about how to set up a
multinomial logistic regression model to do a multi-class classification. I
would really appreciate if any of you would give me some of your thoughts and
recommendation.
Let's say we have 3-class classification problem: A, B and C. I have certain
number of samples, with each sample, I have 3 variables (Xa, Xb and
2013 Apr 16
1
avoid losing data.frame attributes on cbind()
Dear all,
How should I add several variables to a data frame without losing the
attributes of the df? Consider the following:
> require(Hmisc)
> Xa <- iris
> label(Xa, self=T) <- "Some df label"
> str(Xa)
'data.frame': 150 obs. of 5 variables:
$ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
$ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9
2004 Mar 10
3
converting lists got by tapply to dataframes
I have two lists:
xa <- list( X=c(1,2,3), Y=c(4,5,6), Z=c(7,8,9) )
xb <- with( barley, tapply( X=seq(1:nrow(barley)), INDEX=site
, FUN=function(z)yield[z]))
I can convert xa to a dataframe easily with:
as.data.frame(xa)
But if i try the same with xb I get:
as.data.frame(xb)
Error in as.data.frame.default(xb) :
can't coerce array into a data.frame
What
2002 Feb 08
0
Re: [S] Problem with Merge
Don,
I had meant this for r-help, but it probably is the same in S.
The last time I tried to use rbind in R, it screwed up the data frame if
the data frame contained dates or character vectors. Apparently that has
been changed. Although there is still no reason why merge should not work
in the case where all vectors are in common. It's an uncessary restriction
which isn't even mentioned
2012 Jul 10
3
fill 0-row data.frame with 1 line of NAs
Dear all
Is there a simpler method to achieve the following: When I obtain an
empty data.frame after subsetting, I need for it to contain one line
of NAs. Here's a dummy example:
> (.xb <- iris[ iris$Species=='zz', ])
[1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species
<0 rows> (or 0-length row.names)
> dim(.xb)
[1] 0 5
> (.xa <-
2011 Jul 28
1
Regression with ranges and displaying them in an XY-Plot
Hello UseRs,
I've got 3 variables, the dependent variable Y as well as a max and a min value of the independent variable (Xa and Xb) where in some cases Xa=Xb (so actually a single value for X).
First I'd like to perform a regression, but my problem is that my X is a range (acutally a censored independent variable Xa-Xb) rather then one single value. I know already some possible
2017 May 30
1
Pseudo-instruction that overwrites its input register
The reason the ones in PPCInstrInfo.td don't have the patterns to match is
the reason they are more analogous to your problem. Namely, tblgen does not
have a way to produce nodes with more than one result. The load-with-update
instructions do exactly that - one of the inputs is also an output, but the
other output is independent (and necessarily a separate register). The FMA
variants have
2011 Oct 10
4
correlation matrix
Hello Gurus
I have two correlation matrices 'xa' and 'xb'
set.seed(100)
d=cbind(x=rnorm(20)+1,
x1=rnorm(20)+1,
x2=rnorm(20)+1)
d1=cbind(x=rnorm(20)+2,
x1=rnorm(20)+2,
x2=rnorm(20)+2)
xa=cor(d,use='complete')
xb=cor(d1,use='complete')
I want to combine these two to get a third matrix which should have half
values from 'xa' and half
2004 Nov 12
1
dyn.load problem
Hi R-Users
I wrote 1 week ago asking about a message that appears when I try run
dyn.load.
I'm trying to do an example in C code from "Writing R Extension" to
learn how to do it.
I have R 2.0.0, Rtools, Perl and MinGW as describe in
http://www.murdoch-sutherland.com/Rtools/ with path sets.
When I use C:\R\rw2000\bin>RCMD SHLIB -o C:/dev-cpp/teste.dll
2011 Nov 22
5
x, y for point of intersection
Hi everyone,
?
I am trying to get a point of intersection between a
polyline and a straight line ?.. and get the x and y coordinates of this point.
For exemplification consider this:
?
?
set.seed(123)
?
k1 <-rnorm(100, mean=1.77, sd=3.33)
?k1 <- sort(k1)
q1 <- rnorm(100, mean=2.37, sd=0.74)
q1 <- sort(q1, decreasing = TRUE)
plot(k1, q1, xlim <- c((min(k1)-5),
2004 Jun 30
1
AS_NUMERIC and as.numeric - Could someone explain?
Dear List,
I stepped into a strange effect which I can't explain to myself
(probably due to lack of knowledge on R internals).
I have four vectors a,b,c and z of size 10000 each. With these vectors I
call
.Call("hyp2f1forrey", a, b, b, z, PACKAGE = "hyp2f1")
to access
SEXP hyp2f1forrey(SEXP a, SEXP b, SEXP c, SEXP x)
{
int i,n;
double *xa, *xb, *xc, *xx,
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi,
I am not sure if this is a bug and I apologize if it is something I
didn't read carefully in the R extension manual. My initial search on the
R help and R devel list archive didn't find useful information.
I am using .Call (as written in the R extension manual) for the C code
and have found that the .Call didn't release the memory claimed by
allocVector. Even after applying
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi,
I am not sure if this is a bug and I apologize if it is something I
didn't read carefully in the R extension manual. My initial search on the
R help and R devel list archive didn't find useful information.
I am using .Call (as written in the R extension manual) for the C code
and have found that the .Call didn't release the memory claimed by
allocVector. Even after applying
2013 Jul 16
2
Problem following an R bug fix to integrate()
I have been told by the CRAN administrators that the following code generated
an error on 64-bit Fedora Linux (gcc, clang) and on Solaris machines (sparc,
x86), but runs well on all other systems):
> fn <- function(x, y) ifelse(x^2 + y^2 <= 1, 1 - x^2 - y^2, 0)
> tol <- 1.5e-8
> fy <- function(x) integrate(function(y) fn(x, y), 0, 1,