Displaying 20 results from an estimated 300 matches similar to: "how to improve the precison of this calculation?"
2011 Feb 11
3
How can we make a vector call a function element-wise efficiently?
Hello
I have a time-comsuming program which need to simplify, I have tested the annotated program as follow:
> #define function which will be call
> calsta <- function(c, n=100000)
+ {
+ i <- seq(from=0, length=c)
+ logx <- lchoose(NT-n, CT-i) + lchoose(n, i)
+ logmax <- max(logx)
+ logmax + log(sum(exp(logx - logmax)))
+ }
> CT=6000 #assignment to CT
>
2011 Jan 07
4
how to calculate this natural logarithm
Hello
I want to calculate natural logarithm of sum of combinations as follow: (R code)
{
com_sum=choose(2000000,482)*choose(1000000,118)+choose(2000000,483)*choose(1000000,117)+...+choose(2000000,i)*choose(1000000,600-i)+...+choose(2000000,600)*choose(1000000,0) #calculate the sum
result=log(com_sum) #calculate the log of the sum
}
But
2003 Oct 22
1
: Prediction interval for a Gaussian family log-link model
Hi there fellow R-users,
Can anyone tell me how to build a prediction interval for a gaussian
log-link model for the reponse variable??
I can find the standard error of the predictions but I cant seem to find the
prediction interval. Is there a way I can calculate the
prediction interval from the standard errors??
Here's the example:
logX<-rnorm(100)
2010 Aug 26
3
Using termplot() with transformations of x
Hi all
I was playing with termplot(), and came across what appears to be an inconsistency.
It would appreciate if someone could enlighten me:
> # First, generate some data:
> y <- rnorm(100)
> x <- runif(length(y),1,2)
> # Now find the log of x:
> logx <- log(x)
>
> # Now fit two models that are exactly the same, but specified differently:
> m1 <-
2023 Nov 04
2
EPYC Quantum 1500va
Good Evening, I recently purchased an EPYC quantum UPS. I installed
NUT on the home assistant by connecting the UPS via USB and tried all
the various drivers in the list, the only one that seems to work is:
usbhid-ups
with this log:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
2019 Jun 24
2
Calculation of e^{z^2/2} for a normal deviate z
>>>>> William Dunlap via R-devel
>>>>> on Sun, 23 Jun 2019 10:34:47 -0700 writes:
>>>>> William Dunlap via R-devel
>>>>> on Sun, 23 Jun 2019 10:34:47 -0700 writes:
> include/Rmath.h declares a set of 'logspace' functions for use at the C
> level. I don't think there are core R functions that call
2019 Jun 24
1
Calculation of e^{z^2/2} for a normal deviate z
>>>>> jing hua zhao
>>>>> on Mon, 24 Jun 2019 08:51:43 +0000 writes:
> Hi All,
> Thanks for all your comments which allows me to appreciate more of these in Python and R.
> I just came across the matrixStats package,
> ## EXAMPLE #1
> lx <- c(1000.01, 1000.02)
> y0 <- log(sum(exp(lx)))
> print(y0) ## Inf
2024 Nov 01
1
NUT 2.8.1-3 " Can't claim USB device [051d:0002]@0/0: Entity not found" using usbhid-ups
Hi Jim,
Thanks for your help. I'll respond in the same order as you did:
1. Unfortunately, I did "chown" stuff to these created users... Since
the other three responses don't seem to be what you're looking for (but
that's only my uninformed interpretation), I suppose the problem lies here?
Is there a number of files/directories that I should
2024 Nov 01
1
NUT 2.8.1-3 " Can't claim USB device [051d:0002]@0/0: Entity not found" using usbhid-ups
Hello,
I was thinking about what could be going wrong here, and a few ideas pop
up:
1) If you installed NUT from packaging, there should have been no need to
add OS groups/users manually. There is a valid use-case for running
different daemons under different accounts, as long as they talk over
network and access same files or UNIX sockets at best by sharing a group
for that, but it does need
2009 Mar 13
7
Weird Load and Battery Temp Readings
I've acquired and installed NUT 2.4.1 on a D-Link DNS323 NAS. With
exception of Load and Battery Temp readings all works well. A upsc
ups at localhost command returns;
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2008/06/05
battery.runtime: 2122
battery.runtime.low: 120
battery.temperature: 3022999999999998800
battery.type:
2011 Feb 26
0
A problem about realized garch model
Hi, I am trying to write the Realized GARCH model with order (1,1)
The model can be describe bellow:
r_t = sqrt( h_t) * z_t
logh_t = w + b*logh_(t-1) + r*logx_(t-1)
logx_t = c + q*logh_t + t1*z_t +t2*(z_t ^2 -1) + u_t
and z follow N(0,1) , u follow N(0, sigma.u^2)
But I'm troubled with the simulation check for my code.
After I simulate data from the model and estimate the data,
I
2012 Mar 21
5
Socomec sicon Netys 2000 PR ups USb driver for ubuntu
Hello i tried to connect my netys 2000 pr ups to ubuntu 11.10 and i have a problem connecting it. After readin a few post i realized to dianosse the connection.
I need help resolving the connextion issue
So here is the response to??/lib/nut/usbhid-ups -u root -DDDDD -a netys:
Network UPS Tools - Generic HID driver 0.35 (2.6.1)
USB communication driver 0.31
? ?0.000000 ? ? send_to_all: SETINFO
2007 Nov 05
1
Help with cochran.test
Hi,
I have been trying to use the function cochran.test from the Outliers
package to test for homogeneity of variance. This works well except when
I use transformed data. Would anyone have an idea why it doesn't work
and how I could do the cochran test on transformed data?
Thanks,
Stephanie
>library(outliers)
> set.seed(1234)
> x=rnorm(100)
>
2010 Jan 12
1
barplot: border color when stacked
Dear R-users,
I am using R version 2.10.1 under windows.
In a barplot, I want to mark one of the bars with a special border color.
For example:
barplot(c(3, 7, 11), border = c(NA, "red", NA))
But how to do this when the bars are stacked?
for example:
barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try:
barplot(matrix(1:6,
2009 Sep 22
0
snowfall: sfExport apparently harmless error
I'm running my script using mpirun -mp 4 and using snowfall+Rmpi on
Linux 64bits. I receive the following error, but apparently without
consequences on the results.
Any idea?
I'm able to reproduce it with a minimal script (below). Seems the
critical issue is the for loop. Without it no error.
Thanks for your help!
TERM: Undefined variable.
TERM: Undefined variable.
TERM: Undefined
2008 Jun 05
0
bug in barplot.default (graphics) (PR#11585)
There seems to be a minor bug in barplot.default when used with log scale w=
here one or more values is NA:
dat <- matrix(1:25, 5)
dat[2,3] <- NA
barplot(dat, beside =3D T) #Plots and appropriate barplot with gaps for m=
issing data
barplot(dat, beside =3D T, log =3D "y")
#Error in if (min(height + offset) <=3D 0) stop("log scale error: at least =
one 'height +
2019 Jun 23
2
Calculation of e^{z^2/2} for a normal deviate z
I agree with many the sentiments about the wisdom of computing very
small p-values (although the example below may win some kind of a prize:
I've seen people talking about p-values of the order of 10^(-2000), but
never 10^(-(10^8)) !). That said, there are a several tricks for
getting more reasonable sums of very small probabilities. The first is
to scale the p-values by dividing the
2014 Feb 25
0
Setting UPS values can be confusing
Windows 7 Pro x64, NUT 2.6.5-4 (interim release)
Product: Back-UPS RS 1200 FW:8.g3 .D USB FW:g3
Setting UPS values can be confusing. For example, battery.charge.low and
battery.runtime.low.
Using upsrw, the values will be retained after restarting the OS, but
not if the UPS is turned off/restarted.
In the driver log (below), it looks like the values are obtained from
the UPS, but if I set
2019 Jun 23
0
Calculation of e^{z^2/2} for a normal deviate z
include/Rmath.h declares a set of 'logspace' functions for use at the C
level. I don't think there are core R functions that call them.
/* Compute the log of a sum or difference from logs of terms, i.e.,
*
* log (exp (logx) + exp (logy))
* or log (exp (logx) - exp (logy))
*
* without causing overflows or throwing away too much accuracy:
*/
double Rf_logspace_add(double
2019 Jun 24
0
Calculation of e^{z^2/2} for a normal deviate z
Hi All,
Thanks for all your comments which allows me to appreciate more of these in Python and R.
I just came across the matrixStats package,
## EXAMPLE #1
lx <- c(1000.01, 1000.02)
y0 <- log(sum(exp(lx)))
print(y0) ## Inf
y1 <- logSumExp(lx)
print(y1) ## 1000.708
and
> ly <- lx*100000
> ly
[1] 100001000 100002000
> y1 <- logSumExp(ly)
> print(y1)
[1] 100002000