search for: stats4

Displaying 20 results from an estimated 272 matches for "stats4".

Did you mean: stats
2012 Jul 30
1
confusion over S3/S4 importing
...ure 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 "profile" defined from package "stats" function (fitted, ...) standardGeneric("profile") <environment: 0xa59a364> In the bbmle package I want to define it as an S4 method: setMethod(&qu...
2006 Oct 24
2
Installing stats4 package
Hi, I wantto use 'mle' function in R on linux. As I see its been integrated into the stats4 package. Am I correct ? If yes, Can anyone suggest how to install the stats4 package to be able to run 'mle' function in R on linux ? Otherwise how to sort out this problem ? Thanks Himanshu [[alternative HTML version deleted]]
2012 Jul 05
3
Maximum Likelihood Estimation Poisson distribution mle {stats4}
Hi everyone! I am using the mle {stats4} to estimate the parameters of distributions by MLE method. I have a problem with the examples they provided with the mle{stats4} html files. Please check the example and my question below! *Here is the mle html help file * http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html http://s...
2007 Dec 06
1
S3 and S4 clash
Hello: How can I work around the conflict between the S3 and S4 illustrated in the example below? I'm developing a package that requires a function in 'stats4', but when 'stats4' is attached, it breaks my AIC function. I could give my AIC function another name so it no longer uses the generic dispatch, but I wonder if there is another way. Thanks, Spencer Graves ################################ bar.tmp <- structure(1, clas...
2014 Jul 06
2
Depot for S3 to S4 generics (as in stats4)?
...cs for existing S3 ones in the base package is concerned to be a threat to quick startup times [1]. But since S4 is promoted, and S3/S4 interoperability a pain when package developing [2], are there efforts to improve the situation? E.g. an S3 free system, etc. A good thing [2] is the package 'stats4', including some setGeneric calls (e.g. for summary, plot, ...) which I can 'importFrom' to a NAMESPACE. Nevertheless, functions as as.matrix, as. dist, merge, duplicated, and for sure some others, are not available as S4 generics. So my question is: will the base/graphics/... S3 generi...
2007 May 23
2
make check problem
...uwin32>make check make check -------- Testing package base -------- Running examples in 'base-Ex.R' ... Comparing `base-Ex.Rout' to `base-Ex.Rout.prev' ...diff: extra operand `Settings/Erin/Local' diff: Try `diff --help' for more information. OK ; -------- Testing package stats4 -------- Running examples in 'stats4-Ex.R' ... Comparing `stats4-Ex.Rout' to `stats4-Ex.Rout.prev' ...diff: extra operand `Settings/Erin/Local' diff: Try `diff --help' for more information. OK -------- Testing package tcltk -------- Running examples in 'tcltk-Ex.R' ....
2004 Sep 13
2
Problem with mle in stats4 (R 1.9.1)
Hi! This is a repost of an earlier message (with a clearer example demonstrating the problem I ran into). If you run the mle example in stats4 library(stats4) 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)) (fit <- mle(ll)) plot(profile(fit), absVal=FALSE) everything works fine. Now run...
2007 Aug 13
1
[Fwd: behavior of L-BFGS-B with trivial function triggers bug in stats4::mle]
...uot; behaves differently from all of the other optim() methods, which return the value of the function when they are given a trivial function (i.e., one with no variable arguments) to optimize. This is not a bug in L-BFGS-B (more like a response to an undefined condition), but it leads to a bug in stats4::mle -- a spurious error saying that a better fit has been found during profiling if one tries to profile a 1-parameter model that was originally fitted with "L-BFGS-B". One possible fix is to check for length(start)==0 and return a dummy optim() result in that case (see patch include...
2011 Aug 03
0
confint() in stats4 package
Hi there, I had a problem when I hoped to get confidence intervals for the parameters I got using mle() of stats4 package. This problem would not appear if ``fixed'' option was not used. The following mini-example will demo the problem: x <- c(100, 56, 32, 18, 10, 1) r <- c(18, 17, 10, 6, 4, 3) n <- c(18, 22, 17, 21, 23, 20) loglik.1 <- function(alpha, beta, c) { x <- log10(x)...
2007 Jul 29
1
behavior of L-BFGS-B with trivial function triggers bug in stats4::mle
...S-B", all of the other optim() methods return the value of the function when they are given a trivial function (i.e., one with no variable arguments) to optimize. I don't think this is a "bug" in L-BFGS-B (more like a response to an undefined condition), but it leads to a bug in stats4::mle -- a spurious error saying that a better fit has been found during profiling if one tries to profile a 1-parameter model. I haven't dug quite all the way to the bottom of this yet, but the attached code will clearly show the problem. In the version of mle that I've built (which...
2004 Oct 06
1
R 2.0.0: namespaces, S4 classes & versioned package installation: failure to resolve correct pkg version
...extension. The problem does not occur if installed wo --with-package-versions option. The traceback of the actual call is given below, but there is no simple reproducible example I have come up with yet. An reproducible case that might be of some help and give some further insights: I installed stats4 from the R-source-tree/src/library with --with-package-versions In R >library("stats4_2.0.0") >search() [1] ".GlobalEnv" "package:stats4_2.0.0" "package:stats" [4] "package:graphics" "package:grDevices" "pack...
2018 Jan 12
5
Help with packages (methods, stats, stats4)
hello, Can you please give me a hand with this problem,well i can't install these packages: - stats - methods - stats4 when i tried the following command : *library(help = "stats") * , it gave me this output (*see picture*), so i contacted the Maintainer of the package at (*R-core at r-project.org <R-core at r-project.org>*) but he said that i write to the wrong place. (i want to install those pa...
2009 Oct 06
2
mle from stats4
I am using mle as a wrapper from optim( ). How would I extract the convergence code, to know that optim( ) converged properly? Thanks, Stephen Collins, MPP | Analyst Global Strategy | Aon Benfield [[alternative HTML version deleted]]
2008 Dec 11
1
help with predict in stats4
Hi, We're using stats4 for a logistic regression. The code is chdreg.logit2 <- glm(chd ~ age + sex, family = binomial) summary(chdreg.logit2) oddsratios <- coef(chdreg.logit2) exp(oddsratios) # Calculate model predicted values pred <- predict(chdreg.logit2,type="response") The glm part runs fine, a...
2009 Feb 02
0
Using Information from the Stats4 package in base envir
Hi. Thank you very much in advance for your help. I have generated data from two simple linear models and used k-means clustering (stats4) to identify two clusters in the generated data. Next, I would like to do simple linear regression for each separate cluster. I can do this if I first use the cluster labels to define two separate data frames with the subset function. However, I would ideally like to use the subset option in...
2018 Jan 12
0
Help with packages (methods, stats, stats4)
...j to the moderator to stop the approval of the mail . have a good day. 2018-01-12 15:42 GMT+00:00 imane hajar <imane.chafiki.fst at gmail.com>: > hello, > Can you please give me a hand with this problem,well i can't install > these packages: > - stats > - methods > - stats4 > > when i tried the following command : *library(help = "stats") * , it > gave me this output (*see picture*), so i contacted the Maintainer of the > package at (*R-core at r-project.org <R-core at r-project.org>*) but he said > that i write to the wrong place. >...
2012 Feb 26
0
Comments on R_exts section 1.6.6, Namespaces with S4 classes and methods
...s that the corresponding generics are available: the requirementa on this are stricter as from R 2.15.0. You may for example need to import plot from graphics to make visible a function to be converted into its implicit generic. But it is better practice to make use of the generics exported by stats4 as this enables multiple packages to unambiguously set methods on those generics." (note typo on 'requirementa') I agree that existing generics should be reused. The advice points to a very unsatisfactory contortion -- use the generic from stats4 for a function in graphics! It is...
2008 May 08
3
MLE for noncentral t distribution
I have a data with 236 observations. After plotting the histogram, I found that it looks like non-central t distribution. I would like to get MLE for mu and df. I found an example to find MLE for gamma distribution from "fitting distributions with R": library(stats4) ## loading package stats4 ll<-function(lambda,alfa) {n<-200 x<-x.gam -n*alfa*log(lambda)+n*log(gamma(alfa))-(alfa- 1)*sum(log(x))+lambda*sum(x)} ## -log-likelihood function est<-mle(minuslog=ll, start=list(lambda=2,alfa=1)) Is anyone how how to write down -log-likelihood function for...
2009 Oct 07
1
2 questions about mle() /optim() function in stats4
Dear All, There are two things about mle() that I wasn't so sure. 1) can mle() handle vector based parameter? say ll<-function(theta=rep(1,20)){..............} I tried such function, it worked for "optim" but not for "mle". 2) is there a general suggestion for the maximum number of parameters allowed to use in mle() or optim()? Thank you. Regards, MJO
2018 Jan 12
2
Help with packages (methods, stats, stats4)
...t; > have a good day. > > > 2018-01-12 15:42 GMT+00:00 imane hajar <imane.chafiki.fst at gmail.com>: > > > hello, > > Can you please give me a hand with this problem,well i can't install > > these packages: > > - stats > > - methods > > - stats4 > > > > when i tried the following command : *library(help = "stats") * , it > > gave me this output (*see picture*), so i contacted the Maintainer of the > > package at (*R-core at r-project.org <R-core at r-project.org>*) but he said > > that i write...