search for: ll2

Displaying 14 results from an estimated 14 matches for "ll2".

Did you mean: l2
2012 May 13
1
how to write data using xlsReadWrite
...ot image #plot(y) y.modwt <- modwt.2d(y, "la8", 2) ## Level 2 decomposition par(mfrow=c(2,2), pty="s") ##Plot wavelets image(y.modwt$LH2, col=rainbow(128), axes=FALSE, main="LH2") image(y.modwt$HH2, col=rainbow(128), axes=FALSE, main="HH2") image(y.modwt$LL2, col=rainbow(128), axes=FALSE, main="LL2") image(y.modwt$HL2, col=rainbow(128), axes=FALSE, main="HL2") #-------------------------------------------------------------------# ##Get the dimension ##LH2 dimLH2 <- dim(y.modwt$LH2) dimLH2x <- dimLH2[1] dimLH2y <- dimLH2[2]...
2012 May 13
4
write data using xlsReadWrite
...Plot image #plot(y) y.modwt <- modwt.2d(y, "la8", 2) ## Level 2 decomposition par(mfrow=c(2,2), pty="s") ##Plot wavelets image(y.modwt$LH2, col=rainbow(128), axes=FALSE, main="LH2") image(y.modwt$HH2, col=rainbow(128), axes=FALSE, main="HH2") image(y.modwt$LL2, col=rainbow(128), axes=FALSE, main="LL2") image(y.modwt$HL2, col=rainbow(128), axes=FALSE, main="HL2") #-------------------------------------------------------------------# ##Get the dimension ##LH2 dimLH2 <- dim(y.modwt$LH2) dimLH2x <- dimLH2[1] dimLH2y <- dimLH2[2] v...
2006 Jan 14
1
Different length of objects
Hello, i got an warning message in the following code: f<-1:100 t<-1:100 b<-100 ll2 <- function(b,f,t) { t<-cumsum(t) tn<-t[length(t)] i<-seq(along=f) s1<-(tn*exp(-b*tn)*sum(f[i]))/(1-exp(-b*tn)) s2<-sum((f[i]*(t[i]*exp(-b*t[i])-t[i-1]*exp(b*t[i-1])))/(exp(-b*t[i-1])-exp(-b*t[i]))) s1-s2 } ll2(b,f,t) i think, the problem here is, that t[0] doesn...
2006 Jan 25
0
Log-Likelihood 3d-plot and contourplot / optim() starting values
...t;-seq(0,1,length=50) N<-seq(101,110,length=50) z<-outer(N,phi,loglik_jm(N,phi,t)) persp(phi,N,z, theta = 30, phi = 30, expand = 0.5, col = "lightblue") contourplot(z~N*phi) # but i get some error messages, i don't know why? # if you are interested, the mle function for N is ll2 <- function(N,t) { i<-seq(along=t) n<-length(t) s1<-sum(1/(N-(i-1))) s2<-n/(N-(1/sum(t[i]))*(sum((i-1)*t[i]))) (s1-s2) } # you get this function as usual, if you set the loglikelihood equal zero and differentiate for N # i take the squares of ll2 in order to get the minim...
2012 Oct 29
0
why isn't integrate function working in a likelihood
...u. Z<-rbinom(20,1,0.5) #covariate time<-rgamma(20,shape=2,scale=0.5) #failure time del<-c(0,0,1,1,0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1) #event indicator ll<-function(p){ loglik1<-del*log(exp(Z*p[3])) #log of the first part of the likelihood function haz<-(time*exp(Z*p[3]))*p[1] ll2<-vector("numeric",length(1:20)) for (s in 1:20){ integrand<-function(x) x^(del[s]+1/p[2]-1)*exp(-x/p[2])*exp(-x*haz[s])/(gamma(1+1/p[2])*p[2]^(1/p[2])) ll2[s]<-log(integrate(integrand,0,Inf)$value) } loglik2<-as.vector(ll2) #second part of the likelihood function lik<-sum(l...
2003 Nov 10
5
Subsetting a list of vectors
Hi, I'm trying to subset a list which contains variable length vectors. What I want to do is extract (eg.) the 3rd item in each vector (with length >= 3). At the moment I'm using sapply(list.of.vectors, function(x) {x[3]}). The problem with this is that sapply returns a list of the same length of list.of.vectors so I end up with a whole lot of null entries from those vectors
2017 Dec 21
0
Fitting Beta Distribution
...ary(stats4) dbeta1 <- function(x, shape, ...) dbeta(x, shape, shape, ...) dbeta2 <- function(x, shape){ res <- x^(shape-1)*(1-x)^(shape-1) return(res) } LL1 <- function(shape){ R <- dbeta1(x, shape) res <- -sum(log(R)) return(res) } LL2 <- function(shape){ R <- dbeta2(x, shape) res <- -sum(log(R)) return(res) } set.seed(124) x <-rbeta(1000, 0.2, 0.2) fit_dbeta1 <- fitdistr( x , dbeta1, start=list(shape=0.5) , method="Brent", lower=c(0), upper=c(1)) print("estimate of shape f...
2017 Dec 21
1
Fitting Beta Distribution
...ary(stats4) dbeta1 <- function(x, shape, ...) dbeta(x, shape, shape, ...) dbeta2 <- function(x, shape){ res <- x^(shape-1)*(1-x)^(shape-1) return(res) } LL1 <- function(shape){ R <- dbeta1(x, shape) res <- -sum(log(R)) return(res) } LL2 <- function(shape){ R <- dbeta2(x, shape) res <- -sum(log(R)) return(res) } set.seed(124) x <-rbeta(1000, 0.2, 0.2) fit_dbeta1 <- fitdistr( x , dbeta1, start=list(shape=0.5) , method="Brent", lower=c(0), upper=c(1)) print("estimate of shape f...
2007 Sep 10
1
MLE Function
I am just trying to teach myself how to use the mle function in R because it is much better than what is provided in MATLAB. I am following tutorial material from the internet, however, it gives the following errors, does anybody know what is happening to cause such errors, or does anybody know any better tutorial material on this particular subject. >
2012 May 13
2
Discrete choice model maximum likelihood estimation
...)*(P22=1)*(P33=0) return(L2l) } L1 <- function(b1,b2,b,t) { P11 <- P1(b1,b,t) P22 <- P2(b2,b,t) L1l <- (P11=1)*(P22=0) return(L1l) } # Log-likelihood function llfn <- function(par,a,t) { b1 <- par[1] b2 <- par[2] b3 <- par[3] b <- par[4] lL1 <- log(L1(b1,b2,b,t)) lL2 <- log(L2(b1,b2,b3,b,t)) lL3 <- log(L3(b1,b2,b3,b,t)) llfn <- (a==1)*lL1+(a==2)*lL2+(a==3)*lL3 } est <- optim(par,llfn, method = c("CG"),control=list(trace=2,maxit=2000), hessian=TRUE) And when I run this code I get "cannot coerce type 'closure' to vector of typ...
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
2004 Dec 09
2
wishlist -- names gives slotnames (PR#7410)
Full_Name: Elizabeth Purdom Version: 1.9.1 OS: Windows XP Submission from: (NULL) (171.64.102.199) It would be nice if names(obj) would give slot names as well. Since for many people slots are new, the first thing that happens is you try to access what's in them and can't find how to do it. If you don't know that slotNames() exists, it can be very frustrating. Moreover, if you
2006 Mar 25
67
Your Ruby IDE
Just a poll here i am looking for a good IDE for rails and wondering what you guys use? features i like in an ide code highlites auto code complete file browser Currently i am using dreamwever but the code highliting is really bad its also a pain to set up other doucment types such as .yml data config. -- Posted via http://www.ruby-forum.com/.
2018 Aug 17
4
Replication -O3 optimizations manually
Hi, Stefano I also have the problem as described by Emanuele. You say that clang schedules target-independent and target-dependent passes. However, when I use lli to execute bitcode generated by opt with -O3 or with the same optimization passes as -O3, the performance are still different. So, are there some special operations by -O3 option? I read the source code of opt, but I cannot find the