Displaying 20 results from an estimated 20000 matches similar to: "List or matrix of object"
2018 May 23
2
Comparing results of math function calls
Hello,
Code:
int f1(int a, int b) {
return sqrt(a) > sqrt(b);
}
int f2(int a, int b) {
return a > b;
}
Possibly, under -ffast-math (to ignore NaNs), f1 could be transformed to f2
variant.
Also a transformation could support sin and tan, and reverse comparison for
cos.
Suggestions?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2007 Oct 22
3
Elasticity in Leslie Matrix
Dear R-users,
I would like to calculate elasticities and sensitivities of each parameters
involved in the following transition matrix:
A <- matrix(c(
sigma*s0*f1, sigma*s0*f2,
s, v
), nrow=2, byrow=TRUE,dimnames=list(stage,stage))
The command "eigen.analysis" avaliable in package "popbio" provides
sensibility matrix and elasticity matrix
2003 May 20
1
How to use pakcage SEM
Hi.
I have tried to use Package "SEM".
As a learning, I try to convert a program running well of EQS
which is as follows to SEM:
### EQS ###
/SPECIFICATION
CAS=100; VAR=5 MAT=COR; ANA=COR;
/EQUATIONS
V1=*F1+E1; V2=*F1+E2; V3=*F1+*F2+E3; V4=**F1+*F2*E4;
V5=*F2+E5;
/VAR
E1 TO E5=*; F1*1.0; F2=1.0;
/COV
E1,E2=*; F1,F2=*:
/PRINT
FIT ALL;
/MATRIX ......
/END
This is the converted SEM
2016 Oct 21
3
anonymous function parsing bug?
Hi,
thx for the reply. Unfortunately that is not a simplified version of the
problem. You have a function, call it and get the result (numeric in,
numeric out in that case). For simplicity lets use the "return" case:
##
foobar<-function(x) { return(sqrt(x)) }(2)
##
which is a function (numeric in, numeric out) which is defined, then
gets called and the return value is a function
2010 Oct 21
1
gam plots and seWithMean
hello
I'm learning mgcv and would like to obtain numerical output corresponding
to plot.gam.
I can do so when seWithMean=FALSE (the default)
but only approximately when seWithMean=TRUE.
Can anyone show how to obtain the exact values?
Alternatively, can you clarify the explanation in the manual
"Note that, if seWithMean=TRUE, the confidence bands include
the uncertainty about the
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users,
I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this?
BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively.
Any suggestion to solve this question?
Thanks,
Kate
2007 Aug 03
2
change the names of all listed objects
Dear list members,
I have created seven objects, from a to g, so that ls() gives me
[1] "a" "b" "c" "d" "e" "f" "g"
how can I automatically change their names in
"a1" "b1" "c1" "d1" "e1" "f1" "g1"
It seems simple, ut it is driving me mad.
Thank you very
2006 Nov 30
1
data.frame within a function (PR#9294) (cont'd)
This continues the message "data.frame within a function (PR#9294)" that
was posted on 2006/10/12. Duncan Murdoch kindly replied. I'm using the
current version R 2.4.0, but the same issue exists. Just copy and paste
the following code under R, and compare the output of f1() and f2() and
the output of f3() and f4(). Does anybody have any idea? Thanks.
2004 May 20
4
pmvt problem in multcomp
Hi, all:
Two examples are shown below.
I want to use the multiple comparison of Dunnett.
It succeeded in upper case "example 1".
However, the lower case "example 2" went wrong.
In "example 2", the function pmvt return NaN, so I cannot show
this simtest result. Is there any solution?
(I changed the variable "maxpts" to a large number in front of
the
2006 Mar 30
2
Plotting a segmented function
This might be a trivial question, but I would appreciate if anybody
could suggest an elegant way of plotting a function such as the
following (a simple distribution function):
F(x) = 0 if x<=0
=(x^2)/2 if 0<x<=1
=2x-((x^2)/2)-1 if 1<x<=2
=1 if x>2
This is just an example. In this case it is a continuous function. But
how to do it in general in an elegant way.
2006 Nov 18
1
Questions regarding "integrate" function
Hi there. Thanks for your time in advance.
I am using R 2.2.0 and OS: Windows XP.
My final goal is to calculate 1/2*integral of
(f1(x)^1/2-f2(x)^(1/2))^2dx (Latex codes:
$\frac{1}{2}\int^{{\infty}}_{\infty}
(\sqrt{f_1(x)}-\sqrt{f_2(x)})^2dx $.) where f1(x) and f2(x) are two
marginal densities.
My problem:
I have the following R codes using "adapt" package. Although "adapt"
2009 Jul 08
6
variable global
buen dia a toda la comunidad
estoy empezando a usar r y en una implementacion que estoy haciendo requiero que 2 valores que se calculan en una funcion puedan ser vistos en otra pero no he podido hallar la forma he buscado la forma de hacer las variables globales pero no he podido alguien sabe como hacerlo
mil gracias, saludos
Enrique RAMOS
¡Obtén la mejor experiencia en la web! Descarga
2008 Jun 03
3
How to solve a non-linear system of equations using R
Dear R-list members,
I've had a hard time trying to solve a non-linear system (nls) of equations
which structure for the equation i, i=1,...,4, is as follows:
f_i(d_1,d_2,d_3,d_4)-k_i(l,m,s) = 0 (1)
In the expression above, both f_i and k_i are known functions and l, m and s
are known constants. I would like to estimate the vector d=(d_1,d_2,d_3,d_4)
which is solution
2008 Nov 10
3
how to stop without error message?
Dear list
Can anyone suggest a simple way to abort execution like stop(...) does, but without issuing an "Error: ..." message?
I don't want to set 'options( show.error.messages=TRUE)' because I want normal behaviour to resume after this particular stop.
(Please reply personally as well as to the list, as I'm not subscribed to R-help)
Thanks
Mark
--
Mark Bravington
2009 Mar 30
1
Comparing Points on Two Regression Lines
Dear R users:
Suppose I have two different response variables y1, y2 that I regress separately on the different explanatory variables, x1 and x2 respectively. I need to compare points on two regression lines.
These are the x and y values for each lines.
x1<-c(0.5,1.0,2.5,5.0,10.0)
y1<-c(204,407,1195,27404313)
x2<-c(2.5,5.0,10.0,25.0)
y2<-c(440,713,1520,2634)
Suppose we need to
2008 Apr 18
3
Function redefinition - not urgent, but I am curious
This is just my curiousity working.
Suppose I write:
f1 <- function(x) x + 1
f2 <- function(x) 2 * f1(x)
f2(10)
# 22
f1 <- function(x) x - 1
f2(10)
# 18
This is quite obvious. But is there any way to define f2
in such a way that we "freeze" the definition of f1?
f1 <- function(x) x + 1
f2 <- function(x)
# put something here
2 * f1(x)
# probably put something else here
2019 Sep 30
5
Is missingness always passed on?
There's a StackOverflow question
https://stackoverflow.com/q/22024082/2554330 that references this text
from ?missing:
"Currently missing can only be used in the immediate body of the
function that defines the argument, not in the body of a nested function
or a local call. This may change in the future."
Someone pointed out (in https://stackoverflow.com/a/58169498/2554330)
2013 Apr 19
1
How to select the scale parameter for Gabor transform (Rwave)?
Dear list,
I am trying to choose the scale parameter for the cgt transform but I don't
know how to do it. In time I would like to be able to separate points 30
samples apart, and in frequency I would like to separate bands 0.04 Hz
apart. I tried the two approaches described below and they gave me
different results. I would appreciate advise on how to do this.
The Rwave Gabor transform uses
2006 Aug 16
1
Specifying Path Model in SEM for CFA
I'm using specify.model for the sem package. I can't figure out how to
represent the residual errors for the observed variables for a CFA
model. (Once I get this working I need to add some further constraints.)
Here is what I've tried:
model.sa <- specify.model()
F1 -> X1,l11, NA
F1 -> X2,l21, NA
F1 -> X3,l31, NA
F1 -> X4,l41, NA
F1 -> X5, NA, 0.20
2011 Feb 14
4
sem problem - did not converge
Someone can help me? I tried several things and always don't converge
# Model
library(sem)
dados40.cov <- cov(dados40,method="spearman")
model.dados40 <- specify.model()
F1 -> Item11, lam11, NA
F1 -> Item31, lam31, NA
F1 -> Item36, lam36, NA
F1 -> Item54, lam54, NA
F1 -> Item63, lam63, NA
F1 -> Item65, lam55, NA
F1 -> Item67, lam67, NA
F1 ->