Displaying 20 results from an estimated 700 matches similar to: "complex conjugates roots from polyroot?"
2000 Nov 28
2
BUG: polyroot() (PR#751)
I have found that the polyroot()
function in R-1.1.1(both solaris
and Win32 version) gives totally
incorrect result. Here is the offending
code:
# Polyroot bug report:
# from R-1.1.1
> sort(abs(polyroot(c(1, -2,1,0,0,0,0,0,0,0,0,0,-2,5,-2,0,0,0,0,0,0,0,0,0,1,-2,1))))
[1] 0.8758259 0.9486499 0.9731015 1.5419189 1.7466214 1.7535362 1.7589484
[8] 2.0216317 2.4421509 2.5098488 2.6615572
2004 Feb 18
1
Complex conjugate?
Is there a function in R that returns the complex conjugate of a matrix
(a la 'CONJ' in IDL or 'Conjugate' in Mathmatica)?
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody
When one is working with complex matrices, "transpose" very nearly
always means
*Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]).
One often writes A^* for the Hermitian transpose.
I have only once seen a "real-life" case
where transposition does not occur simultaneously with complex conjugation.
And I'm not 100% sure that that wasn't a
2007 Feb 02
1
Inaccuracy in ?convolve
Hi,
Man page for 'convolve' says:
conj: logical; if 'TRUE', take the complex _conjugate_ before
back-transforming (default, and used for usual convolution).
The complex conjugate of 'x', of 'y', of both?
In fact it seems that it takes the complex conjugate of 'y' only which
is OK but might be worth mentioning because (1) conj=TRUE is the
2001 Mar 19
2
A limitation for polyroot ? (PR#880)
Dear R Development Team,
I have encountered the following difficulty in using the function polyroot
under either NT4.0 (R version 1.2.1) or linux (R version 0.90.1). In the
provided example, the non-zero root of c(0,0,0,1) depends on the results of
the previous call of polyroot.
R : Copyright 2001, The R Development Core Team
Version 1.2.1 (2001-01-15)
R is free software and comes with
2001 Jul 16
1
polyroot() (PR#751)
In a bug report from Nov.28 2000, Li Dongfeng writes:
-----
I have found that the polyroot()
function in R-1.1.1(both solaris
and Win32 version) gives totally
incorrect result. Here is the offending
code:
# Polyroot bug report:
# from R-1.1.1
> sort(abs(polyroot(c(1,-2,1,0,0,0,0,0,0,0,0,0,-2,5,-2,0,0,0,0,0,0,0,0,0,1,-2))))
[1] 0.8758259 0.9486499 0.9731015 1.5419189 1.7466214 1.7535362
2005 Aug 19
1
Using lm coefficients in polyroot()
Dear useRs,
I need to compute zero of polynomial function fitted by lm. For example
if I fit cubic equation by fit=lm(y~x+I(x^2)+i(x^3)) I can do it simply
by polyroot(fit$coefficients). But, if I fit polynomial of higher order
and optimize it by stepAIC, I get of course some coefficients removed.
Then, if i have model
y ~ I(x^2) + I(x^4)
i cannot call polyroot in such way, because there is
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all
I have run into a case where I don't understand why predict.lrm and
predict.glm don't yield the same results. My data look like this:
set.seed(1)
library(Design); ilogit <- function(x) { 1/(1+exp(-x)) }
ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE))
CONJ <- factor(sample(c("als", "bevor", "nachdem",
2008 Jul 25
1
transcript a matlab code in R
Dear R-users,
I am trying to translate a matlab code for calculating the Local Whittle
estimator in time series with long memory originally written by Shimotsu and
available free in his webpage (
http://www.econ.queensu.ca/pub/faculty/shimotsu/ )
The Matlab code is
=======================================================================================
function[r] = whittle(d,x,m)
% WHITTLE.M
2007 Feb 06
0
convolve: request for "usual" behaviour + some improvements + some fixes
To add to the wish-list for "convolve":
For modeling processes that decay exponentially in time, e.g.,
fluorescence, it is desirable to have a function that convolves an
arbitrary vector with an exponential using an iterative method.
In the TIMP package (which won't be on CRAN till R 2.5.0 is official, but
is for now at www.nat.vu.nl/~kate/TIMP) we implemented this
special-purpose
2001 Jan 17
2
PR#751
I'd just like to report a possible R bug--or rather, confirm an existing one
(bug #751).
I have had some difficulty using the polyroot() function.
For example, in Win 98, R 1.1.1,
> polyroot(c(2,1,1))
correctly (per the help index) gives the roots of 1 + (1*x) + (2*x^2) as
[1] -0.5+1.322876i -0.5-1.322876i
However,
> polyroot(c(-100,0,1))
gives the roots of
[1] 10+0i -10+0i
2009 Mar 20
2
Finding determinants of x-loaded matrix?
R friends,
I need to find the determinant of this matrix
x 1 0 0
1 x 1 0
0 1 x 1
0 0 1 x
det yields x^4-3x^2+1
I can then use polyroot to find the roots of the coefficients.
The question is about the use of "x", which is what I'm solving for.
thanks in advance, and this is a back-burner question.
Apologies if I have posted this incorrectly/to the wrong place, I'm a newbie
2009 Aug 09
1
Inaccuracy in svd() with R ubuntu package
On two laptops running 32-bit kubuntu, I have found that svd(), invoked
within R 2.9.1 as supplied with the current ubuntu package, returns very
incorrect results when presented with complex-valued input. One of the
laptops is a Dell D620, the other a MacBook Pro. I've also verified the
problem on a 32-bit desktop. On these same systems, R compiled from
source provides apparently
2007 Dec 19
1
strange timings in convolve(x,y,type="open")
Dear R-ophiles,
I've found something very odd when I apply convolve
to ever larger vectors. Here is an example below
with vectors ranging from 2^11 to 2^17. There is
a funny bump up at 2^12. Then it gets very slow at 2^16.
> for( i in 11:20 )print( system.time(convolve(1:2^i,1:2^i,type="o")))
user system elapsed
0.002 0.000 0.002
user system elapsed
0.373
2006 Aug 28
3
matrix "Adjoint" function
Hi there,
I'm new to R and despite searching today, I can't
find a function which will compute the adjoint of
a matrix A. Does this adjoint function exist in R?
Thanks in advance!
2003 Jul 03
2
SVD and spectral decompositions of a hermitian matrix
Hi:
I create a hermitian matrix and then perform its singular value
decomposition. But when I put it back, I don't get the original
hermitian matrix. I am having the same problem with spectral value
decomposition as well.
I am using R 1.7.0 on Windows. Here is my code:
X <- matrix(rnorm(16)+1i*rnorm(16),4)
X <- X + t(X)
X[upper.tri(X)] <- Conj(X[upper.tri(X)])
Y <-
2008 Jul 11
1
Comparing complex numbers
Is there an easy way to compare complex numbers?
Here is a small example:
> (z1=polyroot(c(1,-.4,-.45)))
[1] 1.111111-0i -2.000000+0i
> (z2=polyroot(c(1,1,.25)))
[1] -2+0i -2+0i
> x=0
> if(any(identical(z1,z2))) x=99
> x
[1] 0
# real and imaginary parts:
> Re(z1); Im(z1)
[1] 1.111111 -2.000000
[1] -8.4968e-21 8.4968e-21
> Re(z2); Im(z2)
[1] -2
2005 Sep 09
2
two almost identical packages: best practice
Hi
I have written a whole bunch of methods for objects of class "octonion".
[
an octonion is a single column of an eight-row matrix. Octonions have
their own multiplication rules and are a generalization of quaternions,
which are columns of a four-row matrix.
]
So far I've done about a dozen generic functions such as seq.octonion(),
rep.octonion(), [<-.octonion(), and so on
2015 Oct 16
2
potencia fracional de un número negativo
El problema del módulo es que pierde el signo.
En tu caso sale igual porque has invertido el signo del coeficiente en
el polinomio (en realidad se me pasó a a mí advertir que el término
independiente debe ir con signo negativo):
.> polyroot(z=c(0.5,0,0,0,0,1))
[1] 0.7042902+0.5116968i -0.2690149+0.8279428i -0.2690149-0.8279428i
[4] 0.7042902-0.5116968i -0.8705506+0.0000000i
.>
.>
2019 Feb 14
0
Proposed speedup of spec.pgram from spectrum.R
Hello,
I propose two small changes to spec.pgram to get modest speedup when
dealing with input (x) having multiple columns. With plot = FALSE, I
commonly see ~10-20% speedup, for a two column input matrix and the speedup
increases for more columns with a maximum close to 45%. In the function as
it currently exists, only the upper right triangle of pgram is necessary
and pgram is not returned by