Displaying 20 results from an estimated 10000 matches similar to: "model.matrix evaluation challenges"
2012 Jul 30
1
confusion over S3/S4 importing
Can anyone help me figure out the right way to import a method that is
defined as S3 in one package and S4 in another?
Specifically:
profile() is defined as an S3 method in the stats package:
function (fitted, ...)
UseMethod("profile")
<bytecode: 0xa4cd6e8>
<environment: namespace:stats>
In stats4 it is defined as an S4 method:
stats4:::profile
standardGeneric for
2008 Nov 19
1
mle2 simple question - sigma?
I'm trying to get started with maximum likelihood estimation with a
simple regression equivalent out of Bolker (Ecological Models and Data
in R, p302).
With this code:
#Basic example regression
library(bbmle)
RegData<-data.frame(c(0.3,0.9,0.6),c(1.7,1.1,1.5))
names(RegData)<-c("x", "y")
linregfun = function(a,b,sigma) {
Y.pred = a+b*x
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
Hi there
I am trying to learn how to compute mle in R for a multinomial negative
log likelihood function.
I am using for this the book by B. Bolker "Ecological models and data in
R", chapter 6: "Likelihood an all that". But he has no example for
multinomial functions.
What I did is the following:
I first defined a function for the negative log likelihood:
2009 Feb 01
2
Extracting Coefficients and Such from mle2 Output
The mle2 function (bbmle library) gives an example something like the
following in its help page. How do I access the coefficients, standard
errors, etc in the summary of "a"?
> x <- 0:10
> y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
> LL <- function(ymax=15, xhalf=6)
+ -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
> a <- mle2(LL,
2008 Nov 24
0
[R] besselK
[cc'ing to R-devel]
It's moderately obscure to me too, but ...
There are two sets of bessel code in the package, one
in C++ from Chris Bond and the other in FORTRAN from Netlib
(I think). The FORTRAN code is the one that's giving trouble,
you might try just removing the FORTRAN code from the src
directory and trying again.
2009 Nov 03
2
design matrix construction question
with the following simple data frame
dd = structure(list(z = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L
), .Label = c("a", "b"), class = "factor"), x = c(0.3, 0.2, 0.1,
0, 0, 0, 0.2, 0.3)), .Names = c("z", "x"), row.names = c(NA,
-8L), class = "data.frame")
I would like know if it's possible to use model.matrix()
to construct the
2009 Aug 17
2
unnecessary braces?
the version 2 parser thinks I have unnecessary braces,
but I can't find any. False positive or am I missing
something? If a false positive, is there any way to
work around the warning?
* checking Rd files against version 2 parser ... WARNING
Warning: ./man/dbetabinom.Rd:32-34: Unnecessary braces at ?{p(x) = %
(C(N,x)*Beta(N-x+theta*(1-p),x+theta*p))/%
Beta(theta*(1-p),theta*p)}?
2010 Jan 03
0
[R-sig-eco] How to create axes in arbitrary positions?
Dear Zongshan Li,
I'm forwarding this back to r-help ... it's generally best to keep the
conversation going in public, so that (a) other people can chime in with
ideas and suggestions, (b) your question doesn't get lost if the
original respondent doesn't have time to deal with it, (c) the answers
are archived for future reference.
Your example (I've attached it, hope it
2012 Apr 18
1
error estimating parameters with mle2
Hi all,
When I try to estimate the functional response of the Rogers type I
equation (for the mle2 you need the package bbmle):
> RogersIbinom <- function(N0,attackR2_B,u_B) {attackR2_B+u_B*N0}
> RogersI_B <-
mle2(FR~dbinom(size=N0,prob=RogersIbinom(N0,attackR2_B,u_B)/N0),start=list(attackR2_B=4.5,u_B=0.16),method="Nelder-Mead",data=data5)
I get following error message
2008 Jul 21
1
Control parameter of the optim( ): parscale
Hi everybody,
I am using the L-BFGS-B method of the mle2() function to estimate the values
of 6 parameters. mle2 uses the methods implemented in optim. As I got it
from the descriptions available online, one can use the parscale
parameter to tell R somehow what the values of the estimated parameters
should be . . .
Could somebody please help me understand what one has to do actually with
the
2009 Jun 06
1
Reduce: extra args wishlist?
Is there a reason that Reduce() doesn't take a "..." argument that
would allow arbitrary extra arguments to be passed through to the function?
Here is a little example of how this would be convenient:
z <- list(
data.frame(state=c("California"),
cases=0),
data.frame(state=c("California","Massachusetts"),
2009 Jun 08
1
last.warning and Sweave?
Sweave does something clever with warnings, which I have so far been
unable to figure out. There are a couple of threads on the list about
this, but the best in here is a hack to redirect all the output and
stick it back in.
http://www.nabble.com/-R--Sweave-and-warning-messages-td7759353.html#a7759353
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru>
Subject: Bug in cut.POSIXt
Newsgroups: gmane.comp.lang.r.general
Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago)
Hello Everyone,
Before reporting decided to post here first:
tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class =
c("POSIXt",
2009 Apr 23
1
ggplot2/aesthetic plotting advice
Consider the following situation:
we have quantified algal concentrations for
a variety of species using many samples at each
of three years. It seems to make sense to generate
a line plot (matplot-like), with each species plotted
as a separate line, with the points connected to emphasize
the temporal pattern.
The problem: lots of overlapping error bars.
The question: from both a
2008 Dec 07
1
Florida mirror (cran.hostingzero.net) dead?
The CRAN host in Tampa, FL (cran.hostingzero.net)
isn't responding, and hasn't responded in quite a while --
at least problems were reported more than a year ago
(Oct 2007)
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/116706.html
although someone apparently succeeded in July 2008
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/137451.html
Perhaps it's just flaky, and not
2008 Nov 30
1
methods not found inside function?
I am currently attempting to hack the recently
featured profileModels package so that it can
handle models generated by the lme4 (mixed models)
package. I'm getting really confused by different
behavior of summary() before and after loading
the lme4 package, and inside and outside the
profileMethod() function. The basic behavior
is that with lme4 loaded, and "obj" a fitted
object
2009 Jan 04
0
proposed patch to Uniform.Rd
In the wake of discussions about documentation of R's
random number generation (and whether there should be links
to .Random.seed in other places), here is a proposed patch
to Uniform.Rd from 2.8.1. (Watch out for line breaks.)
[R-core may choose not to accept this, but at least it's
easy if they want it.]
cheers
Ben Bolker
*** Uniform.Rd.orig 2009-01-04 14:10:47.000000000 -0500
2009 Aug 13
0
tick.number in ggplot2?
Another dumb ggplot2 question:
a facet plot with free x scale, lots of
different ranges, want to specify that the
x axis ticks be sparse -- only 2 or 3. I was
about to say that I could figure out how to manually
set the ticks for each facet if necessary, but now
that I've looked around some more (at scale_continuous,
facet_grid, facet_wrap, the Book ...) I think I can't
even do that.
2008 Dec 04
1
rgl.snapshot() on Vista
Dear Daniel (and Duncan):
back in January you reported that you were having trouble saving an rgl
movie on Vista. I don't know if you ever got that resolved, but a
student of mine is now having a similar problem, not specific to dynamic
graphics (which would have to be a problem outside of rgl anyway). He
may report more on the symptoms, but essentially rgl.snapshot produces
black or funky
2010 Jan 06
1
wiki down?
Does anyone have an address for a maintainer, or know what's going on?
cheers
Ben Bolker
ben at bolker-lap2:~$ ping wiki.r-project.org
PING econum.umh.ac.be (193.190.194.5) 56(84) bytes of data.
^C
--- econum.umh.ac.be ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 6999ms
ben at bolker-lap2:~$ traceroute wiki.r-project.org
traceroute to