similar to: Fast optimizer

Displaying 20 results from an estimated 5000 matches similar to: "Fast optimizer"

2009 Aug 30
2
aggregating irregular time series
Hi, I have a couple of aggregation operations that I don't know how to accomplish. Let me give an example. I have the following irregular time series time x 10:00:00.021 20 10:00:00.224 20 10:00:01.002 19 10:00:02:948 20 1) For each entry time, I'd like to get sum of x for the next 2 seconds
2009 Jun 24
2
lapply across using multiple columns
Hi, To set a simple an clear picture of what I'd like to do, here is an example. I would like to calculate mean of column A and B bucketed by factor in column X in a data.frame. lapply or aggregate operates on a single column. I found dapply function in some package which doesn't seem to exist any more. Is there anyway that I can accomplish something like this? Thank you so much in
2005 Nov 23
2
How to plot two different lines with different color with the same "plot" function?
Hi,R_Help! I have done something like this: >x<-seq(412,612,1) >plot(x,dpois(x,512),col="blue",type="l") >plot(x,dnorm(x,512,sd=sqrt(512)),col="red",type="l") And now,I want to plot the two lines in the same picture or with the same "plot" action? What should I do? And any advises? Thank you in advance! 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭伖併佇伹
2009 Oct 27
1
Poisson dpois value is too small for double precision thus corrupts loglikelihood
Hi - I have a likelihood function that involves sums of two possions: L = a*dpois(Xi,theta1)*dpois(Yi,theta2)+b*(1-c)*a*dpois(Xi,theta1+theta3)*dpois(Yi,theta2) where a,b,c,theta1,theta2,theta3 are parameters to be estimated. (Xi,Yi) are observations. However, Xi and Yi are usually big (> 20000). This causes dpois to returns 0 depending on values of theta1, theta2 and theta3. My first
2009 Aug 30
2
POSIX time conversion doesn't display digit
Hi, I have the following string that I converted to a POSIXct: > a <- "2009-08-24 10:00:00.213" > a.p <- strptime(a,"%Y-%m-%d %H:%M:%OS") > as.double(as.POSIXct(a.p)) [1] 1251122400 I can't seem to get the decimal fraction of .213 out by casting to double or numeric. Is there anyway to make sure that POSIXct spits that out? Thank you. adschai
2009 Oct 06
2
how to fit time varying coefficient regression model?
Hi - I read through dse package manual a bit. I'm not quite certain how I can use it to estimate a time varying coefficient regression model? I might pick up an inappropriate package. Any suggestion would be greatly appreciated. Thank you. rh
2009 Jun 28
1
Defining class as a member of another class
Hi, When I define a new class (through setClass), members defined in representation argument doesn't seem to like a class. For example, if I do the following: setClass("NotWork",representation=(x="zoo")) It seems to me that representation members will take in only primitive type to R. Is there any way to stuff a class as a member in another class? Thank you. - adschai
2009 Jun 21
1
Need help installing xts package
Hi, I am trying to install package xts. I am using OPENSUSE 11 64 bit. When I invoke: install.pacakges("xts",dependencies=T) I received a lot of "ERROR: compilation failed for package" errors when R tries to install xts dependencies. I do not understand this behavior. I notice one thing. It complains. ERROR: compilation failed for package 'Hmisc' ** Removing
2009 Jun 23
1
Smart way to check if a column with certain name exists in a data.frame
Hi, I have a matrix or data.frame (df). When I would like to check if a column named "x" exists, it becomes my habit to do the following: if (length(which(colnames(df)=="x"))>0) Is there any smarter way to do this? Thank you. adschai [[alternative HTML version deleted]]
2009 Aug 12
1
Smart way to sum a column in a matrix across all members in a list
Hi, I have a list that contains about 100 elements. Each element contains the following matrix structure a b 1 1 4 2 2 5 3 3 6 I'd like to sum column b across all elements. I'm thinking of using lapply or sapply but cannot get it to work. Any help would be really appreciated. Thank you. adschai
2010 Aug 12
1
Need help to understand integrate function
Hi, I'm running into a wall when trying to use the integrate function. I have the following setting: powerLaw2 <- function(x,l1,l2,c0,t0) { idx <- which(x <= 0); if (length(idx) > 0) { x[idx] <- 0; } xl <- (-l1+l2)*log(x/t0); L <- log(c0)-l1*log(x)-log(1+exp(xl)); L <- exp(L); return(L); } plCDF2 <- function(x,l1,l2,c0,t0) {
2010 Mar 30
1
Adding RcppFrame to RcppResultSet causes segmentation fault
Hi, I'm a bit puzzled. I uses exactly the same code in RcppExamples package to try adding RcppFrame object to RcppResultSet. When running it gives me segmentation fault problem. I'm using gcc 4.1.2 on redhat 64bit. I'm not sure if this is the cause of the problem. Any advice would be greatly appreciated. Thank you. Rob. int numCol=4; std::vector<std::string>
2007 Dec 06
1
suggested modification to the 'mle' documentation?
Hello: I wish to again express my appreciation to all who have contributed to making R what it is today. At this moment, I'm particularly grateful for whoever modified the 'mle' code so data no longer need be passed via global variables. I remember struggling with this a couple of years ago, and I only today discovered that it is no longer the case. I'd
2006 Dec 30
3
wrapping mle()
Hi, How can we set the environment for the minuslog function in mle()? The call in this code fails because the "ll" function cannot find the object 'y'. Modifying from the example in ?mle: library(stats4) ll <- function(ymax=15, xhalf=6) { -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE)) } fit.mle <- function(FUN, x, y) { loglik.fun <- match.fun(FUN)
2011 Feb 07
2
question mle again
A few day ago, I was looking for an answer to my question but didn't get one. Anybody who can help now? Hello, I tried to use mle to fit a distribution(zero-inflated negbin for count data). My call is very simple: mle(ll) ll() takes the three parameters, I'd like to be estimated (size, mu and prob). But within the ll() function I have to judge if the current parameter-set gives a nice
2007 Jul 29
1
behavior of L-BFGS-B with trivial function triggers bug in stats4::mle
With the exception of "L-BFGS-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
2011 Jan 27
3
Warning with mle
Hi there, I'm pretty new to the field of fitting (anything). I try to fit a distribution with mle, because my real data seems to follow a zero-inflated poisson distribution. So far, I tried a simple example to see whether I understand how to do it or not: # example count data x <- 0:10 y <- dpois(x, lambda = 1.4) # zero-inflated poisson zip <- function(x, lambda, prop) { (1 -
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://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
2006 Jun 23
1
How to use mle or similar with integrate?
Hi I have the following formula (I hope it is clear - if no, I can try to do better the next time) h(x, a, b) = integral(0 to pi/2) ( ( integral(D/sin(alpha) to Inf) ( ( f(x, a, b) ) dx ) dalpha ) and I want to do an mle with it. I know how to use mle() and I also know about integrate(). My problem is to give the parameter values a and b to the
2006 Jun 02
2
Problem with mle
R 2.3.0 Linux, SuSE 10.0 Hi I have two problems with mle - probably I am using it the wrong way so please let me know. I want to fit different distributions to an observed count of seeds and in the next step use AIC or BIC to identify the best distribution. But when I run the script below (which is part of my original script), I get one error message for the first call of mle: Error in