Displaying 20 results from an estimated 20000 matches similar to: "all.equal: possible mismatch between behaviour and documentation"
2015 Jul 30
1
all.equal: possible mismatch between behaviour and documentation
Dear Jon,
thank you for raising the issue,
>>>>> Jon Clayden <jon.clayden at gmail.com>
>>>>> on Tue, 28 Jul 2015 12:14:48 +0100 writes:
> Sorry; minor clarification. The actual test criterion in the example I
> gave is of course abs((0.1-0.102)/0.1) < 0.01, not abs(0.1) < 0.01. In
> any case, this does not match (my reading of) the docs,
2015 Jul 28
0
all.equal: possible mismatch between behaviour and documentation
Sorry; minor clarification. The actual test criterion in the example I
gave is of course abs((0.1-0.102)/0.1) < 0.01, not abs(0.1) < 0.01. In
any case, this does not match (my reading of) the docs, and the result
is not `TRUE`.
Regards,
Jon
On 28 July 2015 at 11:58, Jon Clayden <jon.clayden at gmail.com> wrote:
> Dear all,
>
> The documentation for `all.equal.numeric` says
2012 Jul 03
1
integral with error:non-finite function value
Hi guys,
I'm trying to use the the integral function to estimate the area under a
PDF and a crossing curve. first I stated the function with several vectors
in it:
fn=function(a,b,F,mu,alpha,xi)
{
x<-vector()
fs<-function(x)
{
c <- (mu+(alpha*(1-(1-F)^xi)/xi))
tmp <- (1 + (xi * (x - mu))/alpha)
((as.numeric(tmp > 0) * (tmp^(-1/xi - 1) *
2011 Mar 09
4
Extracting only odd columns from a matrix
Hi,
This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which some data is stored are of this form:
X1 Y1 X2 Y2 X3 Y3 ... Xn Yn
with n~100. I would like to look at just the X values (i.e. odd column numbers). Is there an easy way to loop round extracting only these columns?
Any help would be appreciated.
2012 Sep 01
1
Vectorial analogue of all.equal()?
Greetings All.
Once again, I am probably missing something fairly accessible,
but since I can't find it I'd welcome advice!
I have a dataframe derived from a text file of data in tabular
format. For one of the variables, say X, I want to select the
subsets which in which X equals a particular value.
Such values are given in the text file like: 2.3978953, and each
such value will occurr
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help,
Here's a simple example of nonlinear curve fitting where nls seems to get
the answer wrong on a very simple exponential fit (my R version 2.7.2).
Look at this code below for a very basic curve fit using nls to fit to (a)
a logarithmic and (b) an exponential curve. I did the fits using
self-start functions and I compared the results with a more simple fit
using a straight lm()
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
Hi,
I have written a small C++ function and compile it.
However in R I can't see the function I have defined in C++.
I have read some web-pages about Rcpp and C++ but it is a bit confusion
for me.
Anyway,
This is the C++-code:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List compute_values_cpp(int totalPoints = 1e5, double angle_increment =
0.01, int radius =
2006 Oct 05
3
mean relative differences from all.equal() (PR#9276)
Full_Name: Brad Christoffersen
Version: 2.3.1
OS: Windows XP
Submission from: (NULL) (128.196.193.132)
Why is the difference between two numbers so different from the "mean relative
difference" output from the all.equal() function? Is this an artifact of the
way R stores numerics? I could not find this problem as I searched through the
submitted bugs. But I am brand new to R so I
2004 Apr 07
1
eigenvalues for a sparse matrix
Hi,
I have the following problem. It has two parts.
1. I need to calculate the stationary probabilities of a Markov chain,
eg if the transition matrix is P, I need x such that
xP = x
in other words, the left eigenvectors of P which have an eigenvalue of
one.
Currently I am using eigen(t(P)) and then pick out the vectors I need.
However, this seems to be an overkill (I only need a single
2004 Sep 29
2
Approximate a f(x,y)
Hi all,
Running simulations, I'm generating market response to 2 factors X&Y..
There is no closed form for the market response.. The results are store in a
matrix Z(X <- seq(.02,.98,.02), Y <- seq(.01,.19,.01))..
For optmization purpose I need to approximate the values for any factor X in
0,02-0,98 and Y in 0,01-0,19
How can I do it ?
For one factor : Xn-1 < x <= Xn
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
.Call("compute_values_cpp")
Also, if you were passing arguments to the C++ function you would need to
declare the function differently.
Do a search on "Rcpp calling C++ functions from R"
HTH,
Eric
On Sun, Dec 3, 2017 at 3:06 AM, Martin M?ller Skarbiniks Pedersen <
traxplayer at gmail.com> wrote:
> Hi,
>
> I have written a small C++ function and compile it.
2011 Mar 25
4
read.xls -> rotate data.frame
Hi to all,
how could I to rotate automatically a data sheet which was imported by
read.xls?
x1 x2 x3 .... xn
y1 1 4 7 ... xn/y1
y2 2 5 8 .... xn/y2
y3 3 6 9 ....xn/y2
yn ... ... ... Xn/Yn
to
y1 y2 y3 .... yn
x1 1 2 3 ..... Yn/x1
x2 4 5 6 .... Yn/x2
x3 7 8 9 .... Yn/x2
xn ... ... ... ..... Yn/xn
Kind regards Knut
2008 Mar 11
1
messages from mle function
Dears useRs,
I am using the mle function but this gives me the follow erros that I
don't understand. Perhaps there is someone that can help me.
thank you for you atention.
Bernardo.
> erizo <- read.csv("Datos_Stokes_1.csv", header = TRUE)
> head(erizo)
EDAD TALLA
1 0 7.7
2 1 14.5
3 1 16.9
4 1 13.2
5 1 24.4
6 1 22.5
> TAN <-
2004 Nov 03
3
fold right - recursive list (vector) operators
The programming language mosml comes with foldr that 'accumulates' a
function f over a list [x1,x2,...,xn] with initial value b as follows
foldr f b [x1,x2,...,xn] = f(x1,...,f(xn-1,f(xn,b))...)
Observe that "list" should have same elements so in R terminology it would
perhaps be appropriate to say that the accumulation takes place over a
'vector'.
I wonder if R
2005 May 05
2
Numerical Derivative / Numerical Differentiation of unknown funct ion
Hi,
I have been trying to do numerical differentiation using R.
I found some old S code using Richardson Extrapolation which I managed to get
to work.
I am posting it here in case anyone needs it.
########################################################################
richardson.grad <- function(func, x, d=0.01, eps=1e-4, r=6, show=F){
# This function calculates a numerical approximation
2012 Apr 16
1
eval a SYMSXP from C
Can someone offer some advice on how to properly evaluate a SYMSXP
from a .Call ?
I have the following in R:
variable xn, with an attribute "mu" which references the variable mu
in the global environment.
I know "references" is a loose term; mu was defined in this fashion as
a way to implement deferred binding:
foo <- function(x,mu) {
attr(x,"mu") <-
1998 Jun 25
1
all.equal
I'm not sure what the process is for this, but can I get the following all.equal
function put in the R base?
Paul Gilbert
____
all.equal <- function(obj1, obj2,...) {UseMethod("all.equal")}
all.equal.default <- function(obj1, obj2, tolerance=.Machine$double.eps)
{if(mode(obj1) != mode(obj2) ) return("modes differ.")
if (length(obj1) !=
2009 Mar 27
1
constraint optimization: solving large scale general nonlinear problems
Hi
I need advice regarding constraint optimization with large number of
variables.
I need to solve the following problem
max f(x1,...,xn)
x1,..xn
x1=g1(x1,...,xn)
.
.
xn=gn(x1,...,xn)
I am using Rdonlp2 package which works well until 40 variables in my
case. I need to solve this problem with over 300 variables. In this case
Rdonlp2 is very very slowly. I know
2011 Mar 25
1
Matching package - Match function
Hi.
I am using the Matching package for propensity score matching. For each
treated unit, I want to find all control units whose propensity scores lie
within a certain distance from the treated unit. The sample code is as
follows:
> library(Matching)
> x <- rnorm(100000)
> y <- rnorm(100000)
> z <- rbinom(100000,1,0.002)
> logit.reg <-
2009 Dec 15
1
Help in R
Hello,
Can anyone give me some suggestion in term of calculating the sum below.
Is there a function in R that can help doing it faster?
x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following:
sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [
(1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] }
The sum in the beginning is over all