Displaying 20 results from an estimated 31 matches for "logb".
Did you mean:
log
2004 Aug 19
0
nlme R vs S plus
...owever, when I put the same
data into R (R 1.9.0), add in the nlme package and run the code, it does
not converge by the max 50 iterations. Is this because the nlme function
is slightly different and if so, is there a way to solve this problem?
The code I am using is below:
W3<-deriv(~A*ti^exp(logB)*exp(-exp(logC)*ti),c("A","logB","logC"),
function(ti,A,logB,logC){})
Lact.nlme<-{nlme(model=MLKYLD~W3(DIM,A,logB,logC),
fixed=A+logB+logC~1,
random=A+logB+logC~1|ID,
data=LacData.x0, start=c(13.41143,log(0.152792),log(0.002494)), control=nlmeControl(ms...
2006 May 17
1
for loops and counter interpolation
Hi
I'm sorry about the triviality of my problem. I have a vector (v) of three
columns (logA, logB, id). I want to compute (and plot) the correlation between
logA and logB for different thresholds of id (e.g. >30, etc). So I tried:
for(i in 1:100){
points(cor(v$logA[v$id>i], v$logB[v$id>i], use="complete.obs"), i))
}
(i created a plot object already)
but it comes with the...
2005 Feb 02
3
publishing random effects from lme
...or the whole model which I
can state?
The data come from an experiment on plant performance with and without
insecticide, with and without grasses present, and across different
levels of plant diversity ("div").
Thanks for your help!
Christoph.
lme(asin(sqrt(response)) ~ treatment + logb(div + 1, 2) + grass,
random = ~ 1 | plotcode/treatment, na.action = na.exclude, method = "ML")
Linear mixed-effects model fit by maximum likelihood
Data: NULL
AIC BIC logLik
-290.4181 -268.719 152.209
Random effects:
Formula: ~ 1 | plotcode
(Intercept)
StdDe...
2012 May 26
1
Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves
Hi all,
given this example
#start
a<-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940,
760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430)
length(a)
b<-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90,
3220,490,20790,290,740,5350,940,3910,0,640,850,260)
length(b)
out<-ks.test(log10(a+1),log10(b+1))
# max distance D
2013 Nov 07
1
R interface to C API Rf_logspace_{add,sub}?
...ons which do that same sort
of thing (log(exp(x)+exp(y)) and log(exp(x)-exp(y)) without unnecessary
floating point errors). They have names like
matrixStats::logSumExp(lx, na.rm=FALSE, ...) (the ... is ignored by the function)
sna::logSub(x,y), logSum(x), logMean(x)
BTYD::addLogs(loga, logb) and subLogs(loga, logb)
Googling for logSumExp (the Python name) indicates that many know this as "LSE"
(the "Log-Sum-Exp trick").
I've seen several instances in R-help recently where user code could be
made more accurate if these were available. They can be written in pu...
2007 Apr 23
3
mongrel in production not using AR Sessions
...t; line in
mongrel_cluster.yml to use production, ActiveRecord Sessions stop working.
Changing this line to development yield the correct result. Entries in
database.yml are correct, and confirmed that the sessions table exists in
both environments and that production is indeed working
(production.logbeing filled up).
Any idea why this would happen ?
Thanks
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070423/10aa09de/attachment-0001.html
2003 Oct 29
1
I have a problem with the log2 function
Dear R users,
according the help(log), the function
log2(x) should give the natural logarithm of x.
I expect in case of x=2 to to get 0.6931, however, R gives me 1 as a result.
Similar, logb(2,2) gives 1 again.
I'm wondering if I have missed something ?
Yours
Frank
--
Frank Mattes, MD e-mail: f.mattes at ucl.ac.uk
Department of Virology fax 0044(0)207 8302854
Royal Free Hospital and tel 0044(0)207 8302997
University College Medical School
London
2005 Feb 02
1
random effects in lme
...or the whole model which I
can state?
The data come from an experiment on plant performance with and without
insecticide, with and without grasses present, and across different
levels of plant diversity ("div").
Thanks for your help!
Christoph.
lme(asin(sqrt(response)) ~ treatment + logb(div + 1, 2) + grass,
random = ~ 1 | plotcode/treatment, na.action = na.exclude, method = "ML")
Linear mixed-effects model fit by maximum likelihood
Data: NULL
AIC BIC logLik
-290.4181 -268.719 152.209
Random effects:
Formula: ~ 1 | plotcode
(Intercept)
StdDev: 0...
2011 May 17
2
can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)
...edu/wiki/pub/Main/RmS/course2.pdf) by the
following code. Could any one help me figure out how to solve this?
setwd('C:/Rharrell')
require(rms)
load('data/counties.sav')
older <- counties$age6574 + counties$age75
label(older) <- '% age >= 65, 1990'
pdensity <- logb(counties$pop.density+1, 10)
label(pdensity) <- 'log 10 of 1992 pop per 1990 miles^2'
counties <- cbind(counties, older, pdensity) # add 2 vars. not in data
frame
dd <- datadist(counties)
options(datadist='dd')
f <- ols(democrat ~ rcs(pdensity,4) + rcs(pop.change,3) +...
2007 Nov 28
1
Histograms and Sturges rule
Dear All,
According to the Sturges rule, the number of classes of a histogram is
the closest integer to
1 + logb(n,base=2)
where n is the number of observations. The function hist(), by
default, uses the Sturges rule. However, the code
x <- 1:200
hist(x)
produces a histogram with 10 classes and not 9 classes as determined
by the Sturges rule. What am I missing?
Thanks in advance,
Paul
2011 Mar 21
1
round, unique and factor
...erret out all the
usages instead, but this was fast and it cured the user's problem.
The bug is back! A data set from a local colleage triggers it.
I can send the rda file to anyone who wishes.
The current code has
digits <- floor((.Machine$double.digits) *
logb(.Machine$double.base,10)) #base 10 digits
Y[,1] <- signif(Y[,1], digits)
which gives 15 digits; should I subtract one more?
Should the documentation change?
In the meantime I'm looking at the more permanent fix of turning time
into a factor, then back at the very end. Because it i...
2007 Dec 18
0
branch cuts of log() and sqrt()
...omplex
infinity, which is not mentioned in the patch. Comments
anyone?]
rksh
245-10:~/scratch/R-devel/src/library/base/man% diff -c Log.Rd
new_Log.Rd
*** Log.Rd Fri Jul 27 16:51:42 2007
--- new_Log.Rd Tue Dec 18 08:57:03 2007
***************
*** 66,71 ****
--- 66,75 ----
\code{logb} is a wrapper for \code{log} for compatibility with
S. If
(S3 or S4) methods are set for \code{log} they will be dispatched.
Do not set S4 methods on \code{logb} itself.
+
+ For complex arguments, the branch cut is standard: there is a branch
+ point at zero and a cut along the neg...
2012 Mar 19
2
hypergeometric function in ‘ mvtnorm’
Is there any way to know how the "dmvt" function computes the hypergeometric
function needed in the calculation for the density of multivariate t
distribution?
--
View this message in context: http://r.789695.n4.nabble.com/hypergeometric-function-in-mvtnorm-tp4483730p4483730.html
Sent from the R help mailing list archive at Nabble.com.
2004 Jul 06
1
vectorizing sapply() code (Modified by Aaron J. Mackey)
..., 5534,
18937),
A=c( 0, 1, 0, 1, 0, 1, 0,
1),
B=c( 0, 0, 1, 1, 0, 0, 1,
1),
C=c( 0, 0, 0, 0, 1, 1, 1,
1)
);
ct <- round(logb(length(d$ix), 2))
ll <- function( th=0.5,
a1=log(0.5), a2=log(0.5), a3=log(0.5),
b1=log(0.5), b2=log(0.5), b3=log(0.5)
) {
a <- exp(sapply(1:ct, function (x) { get(paste("a", x, sep="")) }));
b <- exp(sapply(1:ct, f...
2009 May 04
1
wrong if-else syntax
...t does not like the above syntax. In fact in my script I have the following instructions:
if (DonohoAplhaON){
tms <<- xx[,"sampamp"] #EXTRACT SIGNAL AMPLITUDE
tmsLen <<- length(tms)
J <<- ilogb(tmsLen, base=2)
if (logb(tmsLen, base=2)%%2 > 0) {
J <<- J + 1
}
rm(xx)
rawtms <- tms
X <- PreProcessor(tms,tmsLen,J)
BestWavList <- FindBestWavelet (X,tmsLen,J,Step1NumHighScalesOFF)
if (!is.null(BestWavList)) {...
2004 Jul 08
1
parallel mle/optim and instability
...e)
Thanks, -Aaron
library(stats4);
d <- data.frame( ix=c(0,1,2,3,4,5,6,7),
ct=c(1000,9609,18403,2617,8237,3619,5520,18908),
A=c(0,1,0,1,0,1,0,1),
B=c(0,0,1,1,0,0,1,1),
C=c(0,0,0,0,1,1,1,1)
);
ct <- round(logb(length(d$ix), 2))
ll <- function( th=0.5,
a1=log(0.5), a2=log(0.5), a3=log(0.5),
b1=log(0.5), b2=log(0.5), b3=log(0.5)
) {
a <- exp(sapply(1:ct, function (x) { get(paste("a", x, sep="")) }));
b <- exp(sapply(1:ct, f...
2013 Feb 10
2
exponential model in R
Dear R users,
I don't know how to compute an exponential model like this:
proc=a*exp(b*cls), or proc=a*exp(b*cls)+c*exp(d*cls). Please help me to
solve this problem!
Thank you!
My data is:
row.names proc cls
1 0.5 452.616206 0.5
2 1 255.864021 1.0
3 1.5 150.885316 1.5
4 2 86.289600 2.0
5 2.5 56.321559 2.5
6 3 39.504444 3.0
7 3.5 25.570308 3.5
8 4 5.382726 4.0
--
---
Catalin-Constantin
2003 May 08
1
function to compute entropy
Maybe its slightly off-topic, but can anybody
help with computing entropy on matrix of probabilities?
Guess we have a matrix of probabilites, A, 2x2, something
like this:
z
x 0 1 2 3 4
0 0.063 0.018 0.019 0.016 0.000
1 0.011 0.162 0.040 0.042 0.003
2 0.015 0.030 0.164 0.033 0.002
3 0.012 0.035 0.036 0.159 0.002
4 0.004 0.021 0.018 0.013 0.082
sum(A)=1
Can i
2003 Sep 14
2
Convert decimal to binary data
Hi,
I would like to convert a decimal into a binary number, for instance :
2->(1,0)
Any one knows how to do that ?
Thanks a lot
paul
---
[[alternative HTML version deleted]]
2008 Feb 27
1
Warnings generated by log2()/log10() are really large/takes a long time to display
x <- rnorm(1e6);
y <- log(x); # or logb(x) or log1p(x)
w <- warnings();
print(object.size(w));
## [1] 480
str(w);
$ NaNs produced: language log(x)
- attr(*, "dots")= list()
- attr(*, "class")= chr "warnings"
y <- log2(x); # or log10(x)
w <- warnings();
print(object.size(w));
## [1] 8000536
str(...