Displaying 20 results from an estimated 254 matches for "1i".
Did you mean:
l1i
2016 Mar 18
1
formatting of complex matrix
While working on the printing code, my colleague Zbyn?k ?lajchrt noticed that complex matrixes are sometimes misaligned:
> { matrix(1i,2,13) }
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
[2,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
(the values in the last four columns should be prefixed by two spaces instea...
2023 Nov 09
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
...> instead of NA_complex_?
> My opinions:
> (1) No. The imaginary part of the result of parsing the strings "<b>i",
> "<a>+<b>i", and "<a>-<b>i" can be nonzero.
> Consider, e.g., Im(eval(str2lang("0+1i"))) and Im(as.complex("0+1i")).
> If NA_character_ means "a string with unknown content", then we should
> not assume that the string is parsed as a real number.
> (2) Yes. I'd very much like to preserve the identity of c(Im(NA), Im(x))
> a...
2023 Nov 08
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
...real_, i=0)
instead of NA_complex_?
My opinions:
(1) No. The imaginary part of the result of parsing the strings "<b>i",
"<a>+<b>i", and "<a>-<b>i" can be nonzero.
Consider, e.g., Im(eval(str2lang("0+1i"))) and Im(as.complex("0+1i")).
If NA_character_ means "a string with unknown content", then we should
not assume that the string is parsed as a real number.
(2) Yes. I'd very much like to preserve the identity of c(Im(NA), Im(x))
and I...
2003 Jun 24
3
R-1.7.1 regression test failure on alphaev68-dec-osf5.1
...gression test is failing in the following
manner:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> ## log
> stopifnot(all.equal(log(1:10), log(1:10, exp(1))))
> stopifnot(all.equal(log10(30), log(30, 10)))
> stopifnot(all.equal(log2(2^pi), 2^log2(pi)))
> stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)
Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < .Machine$double.eps is
not TRUE
Execution halted
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran compilers and
perl 5.6.0. I found the above error in a f...
2023 Nov 05
2
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
This is another follow-up to the thread from September "Recent changes to
as.complex(NA_real_)".
A test in data.table was broken by the changes for NA coercion to complex;
the breakage essentially comes from
c(NA, 0+1i)
# vs
c(as.complex(NA), 0+1i)
The former is the output we tested against; the latter is essentially (via
coerceVector() in C) what's generated by our data.table::shift()
However, these are now (r85472) different:
Im(c(NA, 0+1i))
# [1] NA 1
Im(c(as.complex(NA), 0+1i))
# [1] 0 1
The former m...
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
...23 09:41:42 -0800 writes:
> This is another follow-up to the thread from September
> "Recent changes to as.complex(NA_real_)".
> A test in data.table was broken by the changes for NA
> coercion to complex; the breakage essentially comes from
> c(NA, 0+1i)
> # vs
> c(as.complex(NA), 0+1i)
> The former is the output we tested against; the latter is essentially (via
> coerceVector() in C) what's generated by our data.table::shift()
> However, these are now (r85472) different:
> Im(c(NA, 0+1i))
>...
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
...ercion works different that it used to, so that
as.complex(NA) == as.complex(NA_real) == NA_real_+0i)
which now differs from
NA_complex
although both print as NA.
I haven't been quite alert when this change was discussed, but it does look a bit unfortunate that usage patterns like c(NA, 0+1i) does not give complex NA for the 1st component, effectively changing the interpretation from "I don't know what this is" to "I don't know what this is but I'm sure it is on the real line".
Also, notice that things like
> Im(scan(text= "NA 0+1i", what...
2005 Apr 13
2
Inf +1i vs 1+Inf*1i
Hi
If I have
a <- Inf + 1i
then
Re(a) is Inf, and Im(a) is 1, as expected.
But if
b <- 1 + Inf * 1i,
then
Im(b) = Inf , as expected, but Re(b) = NaN, which I didn't expect.
Why this asymmetry? How to define an object with Re(b)=1, Im(b)=Inf?
--
Robin Hankin
Uncertainty Analyst
Southampton Oceanography C...
2023 Nov 07
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
...> This is another follow-up to the thread from September
> > "Recent changes to as.complex(NA_real_)".
>
> > A test in data.table was broken by the changes for NA
> > coercion to complex; the breakage essentially comes from
>
> > c(NA, 0+1i)
> > # vs
> > c(as.complex(NA), 0+1i)
>
> > The former is the output we tested against; the latter is
> essentially (via
> > coerceVector() in C) what's generated by our data.table::shift()
>
> > However, these are now (r85472) differen...
2005 Jun 15
0
(PR#7942) extra spaces before imag part when printing complex numbers
Prof Brian Ripley wrote:
> This is intentional: it aligns the numbers. E.g.
>
> >options(width=12)
> >print(c(1+1i, 1-10i, 1+100i))
> [1] 1+ 1i
> [2] 1- 10i
> [3] 1+100i
>
> Neat, eh?
>
> What made you think this was a bug?
Ah ok, I've misunderstood this feature probably perhaps
because, at first sight, I found the display looks "strange"
when some of the numbers have lar...
2005 Jul 11
1
Sweave and complex numbers
Hi
When using Sweave, most of my functions get called with complex
arguments.
They get typeset in with additions that I don't want; "1+1i" appears
as "1 + (0 + 1i)"
and I would rather have plain old "1+1i".
Example follows:
\documentclass[a4paper]{article}
\title{A Test File}
\author{Robin Hankin}
\usepackage{a4wide}
\begin{document}
\maketitle
A simple example:
<<print=TRUE>>=
f <-...
2006 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %>
which returns in params
:in_out: !map:HashWithIndifferentAccess
time_in(1i): "2006"
time_in(2i): "6"
time_in(3i): "12"
time_in(4i): "20"
time_in(5i): "24"
and I want to save that datetime to a column in the db...
if params[:user][:in_out] == "In"
@in_out.time_in = params[:in_out][:tim...
2014 Jul 14
2
cummax / cummin for complex numbers
Dear all,
in R 3.1.0, this is happening:
> cummin(c(1+1i,2-3i,4+5i))
Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) :
'cummax' not defined for complex numbers
> cummax(c(1+1i,2-3i,4+5i))
Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) :
'cummin' not defined for complex numbers
It may be fixed in R-devel, but I tho...
2020 Nov 05
2
ssacli start rebuild?
Hi,
is there a way to rebuild an array using ssacli with a P410?
A failed disk has been replaced and now the array is not
rebuilding like it should:
Array A (SATA, Unused Space: 1 MB)
logicaldrive 1 (14.55 TB, RAID 1+0, Ready for Rebuild)
physicaldrive 1I:0:1 (port 1I:box 0:bay 1, SATA HDD, 4 TB, OK)
physicaldrive 1I:0:2 (port 1I:box 0:bay 2, SATA HDD, 4 TB, OK)
physicaldrive 1I:0:3 (port 1I:box 0:bay 3, SATA HDD, 4 TB, OK)
physicaldrive 1I:0:4 (port 1I:box 0:bay 4, SATA HDD, 8 TB, OK)
physicaldrive 2I:0:5 (port 2I:box 0:bay...
2011 Oct 23
2
ssd quandry
...: /ssd 186.3 GB
Logical Drive Label: AF36B716PACCRCN810E1R9J646A
# hpacucli ctrl slot=1 show config
Smart Array P410 in Slot 1 (sn: PACCRCN810E1R9J)
....
array C (Solid State SAS, Unused Space: 0 MB)
logicaldrive 3 (186.3 GB, RAID 0, OK)
physicaldrive 1I:1:23 (port 1I:box 1:bay 23, Solid State SAS, 100
GB, OK)
physicaldrive 1I:1:24 (port 1I:box 1:bay 24, Solid State SAS, 100
GB, OK)
# hpacucli ctrl slot=1 show ssdinfo detail
Smart Array P410 in Slot 1
Total Solid State Drives with Wearout Status: 0
Total Smart Array Solid State D...
2010 Mar 31
2
Should as.complex(NaN) -> NA?
...1] NaN
> Im(complex(re=NaN, im=1))
[1] 1
but I don't have a good mental model that explains
why the following produce NA instead of NaN.
> as.complex(NaN)
[1] NA
> Im(complex(modulus=NaN, argument=NaN))
[1] NA
> Re(complex(modulus=NaN, argument=NaN))
[1] NA
> Re(1i * NaN)
[1] NA
> Im(1i * NaN)
[1] NA
> Re(NaN + 1i)
[1] NA
> Im(NaN + 1i)
[1] NA
It may be that if as.complex(NaN), and its C equivalent,
were changed to return complex(re=NaN,im=NaN) then the
arithmetic examples would return NaN. Is there a
better way for me to model how Na...
2011 Jan 03
1
Greetings. I have a question with mixed beta regression model in nlme.
...me package
in R to fit a mixed beta regression model. The details of the model are:
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij})
y_{ij} = mu_{ij} + w_{ij}
*
*with*
*logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij}
log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c2 * z2_{ij}
*
*Beta_{0i} = b_0 + u_{0i}
Beta_{1i} = b_1 + u_{1i}
Gamma_{0i} = c_0 + v_{0i}
Gamma_{1i} = c_1 + v_{1i}
*
*The vector* *(u_{0i}, u_{1i})'* *has normal distribution with mean*
*(0, 0)'* *and covarianc...
2011 Jan 03
0
Greetings. I have a question with mixed beta regression model in nlme (corrected version).
...xed
beta regression model. In any case, here I send you the correct formulation.
**
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij})
y_{ij} = mu_{ij} + w_{ij}
*
*with*
*logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b_2 * x2_{ij}
log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c_2 * z2_{ij}
*
*Beta_{0i} = b_0 + u_{0i}
Beta_{1i} = b_1 + u_{1i}
Gamma_{0i} = c_0 + v_{0i}
Gamma_{1i} = c_1 + v_{1i}
*
*The vector* *(u_{0i}, u_{1i})'* *has normal distribution with mean*
*(0, 0)'* *and covaria...
2006 Jul 06
3
Understanding date_select naming conventions
I am using the date_select helper to generate date select elements in a
form.
I notice that the generated HTML shows that these selects have the
following names:
Month: current_job[StartDate(2i)]
Day: current_job[StartDate(3i)]
Year: current_job[StartDate(1i)]
I''m assuming that the Xi identifiers somehow specify the appropriate
date part from a date or time value.
Can anyone shed some light on how this works? Where can I get definite
info. on it?
Also, I am using select_hour, select_minute, and select_second to handle
the time portion o...
2001 Nov 20
1
warning message
...ello everybody.
I would like to pose a question regarding a warning message after running
a function of my own. The function I created for computing the p-value of
the dw statistic has a command line like this:
»dwf0 <- function(dw,eigen) { carfun <- function(x) {
(prod(1+2*(eigen-dw)*1i*x)^(-1/2)-prod(1-2*(eigen-dw)*1i*x)^(-1/2))/(1i*x) }
; 1/2+integrate(f=carfun,lower = 0,upper = Inf,
subdivisions=10000)$value/(2*pi) }
, with arguments "dw" as a real and "eigen" as a vector.
After I run:
»dwf0(1.314416,c(3.4420282, 2.6472097, 1.8375986, 1.2928912, 0.676...