similar to: fitting a mixed exponential distribution

Displaying 20 results from an estimated 1000 matches similar to: "fitting a mixed exponential distribution"

2011 Jun 14
2
How to generate bivariate exponential distribution?
Any one know is there any package or function to generate bivariate exponential distribution? I gusee there should be three parameters, two rate parameters and one correlation parameter. I just did not find any function available on R. Any suggestion is appreciated. -- View this message in context:
2009 May 16
1
maxLik pakage
Hi all; I recently have been used 'maxLik' function for maximizing G2StNV178 function with gradient function gradlik; for receiving this goal, I write the following program; but I have been seen an error  in calling gradient  function; The maxLik function can't enter gradlik function (definition of gradient function); I guess my mistake is in line ******** ,that the vector  ‘h’ is
2009 Jan 05
1
transform R to C
Dear R users, i would like to transform the following function from R-code to C-code and call it from R in order to speed up the computation because in my other functions this function is called many times. `dgcpois` <- function(z, lambda1, lambda2) { `f1` <- function(alpha, lambda1, lambda2) return(exp(log(lambda1) * (alpha - 1) - lambda2 * lgamma(alpha))) `f2` <-
2006 Jul 07
1
convert ms() to optim()
How to convert the following ms() in Splus to Optim in R? The "Calc" function is also attached. ms(~ Calc(a.init, B, v, off, d, P.a, lambda.a, P.y, lambda.y, 10^(-8), FALSE, 20, TRUE)$Bic, start = list(lambda.a = 0.5, lambda.y = 240), control = list(maxiter = 10, tol = 0.1)) Calc <- function(A.INIT., X., V., OFF., D., P1., LAMBDA1., P2., LAMBDA2., TOL., MONITOR.,
2008 Sep 19
2
Error: function cannot be evaluated at initial parameters
I have an error for a simple optimization problem. Is there anyone knowing about this error? lambda1=-9 lambda2=-6 L<-function(a){ s2i2f<-(exp(-lambda1*(250^a)-lambda2*(275^a-250^a)) -exp(-lambda1*(250^a)-lambda2*(300^a-250^a))) logl<-log(s2i2f) return(-logl)} optim(1,L) Error in optim(1, L) : function cannot be evaluated at initial parameters Thank you in advance -- View this
2008 Sep 12
1
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
I use "while" loop but it produces an errro. I have no idea about this. Error in "[<-"(`*tmp*`, i, value = numeric(0)) : nothing to replace with The problem description is The likelihood includes two parameters to be estimated: lambda (=beta0+beta1*x) and alpha. The algorithm for the estimation is as following: 1) with alpha=0, estimate lambda (estimate beta0
2023 Aug 27
1
Query on finding root
On Fri, 25 Aug 2023 22:17:05 +0530 ASHLIN VARKEY <ashlinvarkey at gmail.com> wrote: > Sir, Please note that r-help is a mailing list, not a knight! ?? > I want to solve the equation Q(u)=mean, where Q(u) represents the > quantile function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is > the quantile function of Davies (Power-pareto) distribution. Hence I > want to
2009 Oct 14
1
different L2 regularization behavior between lrm, glmnet, and penalized?
The following R code using different packages gives the same results for a simple logistic regression without regularization, but different results with regularization. This may just be a matter of different scaling of the regularization parameters, but if anyone familiar with these packages has insight into why the results differ, I'd appreciate hearing about it. I'm new to
2007 Aug 14
2
State Space Modelling
Hey all, I am trying to work under a State Space form, but I didn't get the help exactly. Have anyone eles used this functions? I was used to work with S-PLUS, but I have some codes I need to adpt. Thanks alot, Bernardo [[alternative HTML version deleted]]
2001 Sep 14
1
Supply linear constrain to optimizer
Dear R and S users, I've been working on fitting finite mixture of negative exponential distributions using maximum likelihood based on the example given in MASS. So far I had much success in fitting two components. The problem started when I tried to extend the procedure to fit three components. More specifically, likelihood = sum( ln(c1*exp(-x/lambda1)/lambda1 + c2*exp(-x/lambda2)/lambda2
2009 Jul 02
2
constrained optimisation in R.
i want to estimate parameters with maximum likelihood method with contraints (contant numbers). for example sum(Ai)=0 and sum(Bi)=0 i have done it without the constraints but i realised that i have to use the contraints. Without constraints(just a part-not complete): skellamreg_LL=function(parameters,z,design) { n=length(z); mu=parameters[1]; H=parameters[2]; Apar=parameters[3:10];
2006 Jul 14
1
Optim()
Dear all, I have two functions (f1, f2) and 4 unknown parameters (p1, p2, p3, p4). Both f1 and f2 are functions of p1, p2, and p3, denoted by f1(p1, p2, p3) and f2(p1,p2,p3) respectively. The goal is to maximize f1(p1, p2, p3) subject to two constraints: (1) c = k1*p4/(k1*p4+(1-k1)*f1(p1,p2,p3)), where c and k1 are some known constants (2) p4 = f2(p1, p2, p3) In addition, each parameter
2009 Aug 25
1
Elastic net in R (enet package)
Dear R users, I am using "enet" package in R for applying "elastic net" method. In elastic net, two penalities are applied one is lambda1 for LASSO and lambda2 for ridge ( zou, 2005) penalty. But while running the analysis, I realised tht, I optimised only one lambda. ( even when I looked at the example in R, they used only one penality) So, I am
2010 Sep 29
1
sample exponential r.v. by MCMC
Dear R users, I am leaning MCMC sampling, and have a problem while trying to sample exponential r.v.'s via the following code: samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2, mcmc=5000, burnin=500, thin=10, verbose=500, logfun=FALSE) I tried other distribtions such as Normal, Gamma with shape>1, it works perfectly fine. Can someon
2011 Mar 21
2
Exponential distribution
Dear R-users, I have to plot a exponential distribution like the plot in the pdf attached. I've write this code but I don't know how to draw the two lines.. Can anyone help me please? Thank you very much Pippo http://r.789695.n4.nabble.com/file/n3394476/exponential_smoothing.pdf exponential_smoothing.pdf -- View this message in context:
2008 Sep 11
0
Loop for the convergence of shape parameter
Hello, The likelihood includes two parameters to be estimated: lambda (=beta0+beta1*x) and alpha. The algorithm for the estimation is as following: 1) with alpha=0, estimate lambda (estimate beta0 and beta1 via GLM) 2) with lambda, estimate alpha via ML estimation 3) with updataed alpha, replicate 1) and 2) until alpha is converged to a value I coded 1) and 2) (it works), but faced some
2007 Mar 06
2
Estimating parameters of 2 phase Coxian using optim
Hi, My name is Laura. I'm a PhD student at Queen's University Belfast and have just started learning R. I was wondering if somebody could help me to see where I am going wrong in my code for estimating the parameters [mu1, mu2, lambda1] of a 2-phase Coxian Distribution. cox2.lik<-function(theta, y){ mu1<-theta[1] mu2<-theta[2] lambda1<-theta[3]
2003 Jun 08
2
LDA: normalization of eigenvectors (see SPSS)
Hi dear R-users I try to reproduce the steps included in a LDA. Concerning the eigenvectors there is a difference to SPSS. In my textbook (Bortz) it says, that the matrix with the eigenvectors V usually are not normalized to the length of 1, but in the way that the following holds (SPSS does the same thing): t(Vstar)%*%Derror%*%Vstar = I where Vstar are the normalized eigenvectors. Derror
2008 Nov 15
1
rgamma with rate as vector
Hi - I have a question about the following code from Bayesian Computation with R (Jim Albert). par(mfrow=c(2,2)) m = 500 alphas = c(5, 20, 80, 400) for (j in 1:4) { mu = rgamma(m, shape=10, rate=10) lambda1 = rgamma(m, shape=alphas[j], rate=alphas[j]/mu) lambda2 = rgamma(m, shape=alphas[j], rate=alphas[j]/mu) plot(lambda1, lambda2) title(main=paste('alpha=',
2004 May 13
5
code for functions in base package
Is there any way that I can see the step by step code for functions in the base package? For instance the dexp function. I am a student working on writing my own function for something that is similar to this dexp function and I would like to see the step by step code. Brittany Laine GTA WVU Statistics Department 331 Hodges