search for: lamda

Displaying 20 results from an estimated 40 matches for "lamda".

Did you mean: lambda
2005 Sep 26
2
nls and na/Nan/Inf error
...n Ch8 of Pinheiro & Bates. I am getting the following error (R version 2.1.1) *Error in qr(attr(rhs, "gradient")) : NA/NaN/Inf in foreign function call (arg 1)* Below is the function and data. /# the van genuchten moisture release function vanGen <- function(x, Vr, Vm, alpha, lamda) { if (Vr < 0) Vr <- 0 Vr + (Vm - Vr)/((1+(alpha*x)^lamda)^(1-1/lamda)) } vanGen <- deriv(~Vr + (Vm - Vr)/((1+(alpha*x)^lamda)^(1-1/lamda)), c("Vr", "Vm", "alpha", "lamda"), function(x, Vr, Vm, alpha, lamda) {} )/ the call in R /> fm1fl...
2010 Mar 16
0
recursive term
Hi r-users;   I have this values: eign_val <- c(137.810447,3.538721,2.995161,1.685670) alp    <- 1.6549 ;  lamda <- eign_val lamda_m <- min(lamda)   First I calculated manually: delta0 <- 1 delta1 <- alp*delta0*(4-lamda_m*(1/lamda[1]+1/lamda[2]+1/lamda[3]+1/lamda[4]))  delta1 delta2 <- (alp/2)*(delta1*(delta1/alp) + delta0*((1-lamda_m/lamda[1])^2+ (1-lamda_m/lamda[2])^2+(1-lamda_m/lamda[3])^2+...
2011 Oct 20
1
R code Error : Hybrid Censored Weibull Distribution
...theoretical interpretation of it. I'm sending the code : ######################################################################################### f3<-function(t,r){ #calculation for t1 fb1<-function(t,r){ v1<-numeric(0) for(j in 1:r){ int1<-function(x1){ int_1<- (1/p+log(x1/lamda))^2 * j * choose(n,j) * (pweibull(x1,shape=p,scale=lamda))^(j-1) * (1 - pweibull(x1,shape=p,scale=lamda))^(n-j) * dweibull(x1,shape=p,scale=lamda) int_1 } v1[j]<-integrate(int1,lower=0,upper=t)$value } sum(v1) } #calculation for t2 fb2<-function(t,r){ v2<-numeric(0) for(j in 1:r){ int2&...
2013 Apr 04
5
Help for bootstrapping‏
...a){x = 1:396s = sample(x,6,replace=T)bsdata = data[(s[1]):(s[1]+59),] for (j in 2:6) { a = data[(s[j]):(s[j]+59),] bsdata = rbind(bsdata,a) }return(bsdata)} #set.seed(1234)#trial<-GetBSData(OriData) ##############################the Minimisation functionOpt<-function(data, horizon, col, lamda){TbillReturn<-numeric(30/horizon)USReturn<-numeric(30/horizon)for (x in 1: (30/horizon)){ TbillReturn[x]<-prod(data[(12*horizon*(x-1)+1):(12*horizon*(x-1)+12*horizon),col])-1 USReturn[x]<-prod(data[(12*horizon*(x-1)+1):(12*horizon*(x-1)+12*horizon),2])-1}Return<-cbind(TbillReturn,USR...
2011 Apr 19
1
How to get the tuning parameter lamda in storey's qvalue package
Dear All, In Storey's estimator of the proportion of true nulls, the estimator depends on the tuning parameter lamda. Suppose now that an estimator of this proportion has been obtained by the qvalue package, what is the lamda that corresponds to the estimate? How to get this lamda? Thanks, -Chee [[alternative HTML version deleted]]
2009 Jul 30
1
lmer() and "$ operator is invalid for atomic vectors"
...perator is invalid for atomic vectors" I'll just provide the code, because I don't see where the problem is: library(lme4) options(contrasts=c("contr.helmert","contr.poly")) data = read.csv("C:/Users/Angela/Desktop/Summer_at_CDS/aging_JDM_Martine/datasets/lamda.data_07.27.09.csv", header=TRUE) attach(data) new<-data.frame(lamda, age.o_1, Item.l2_2,Subject) new Subject <- factor(Subject) Age <- factor(age.o_1,levels=c("0","1"),labels=c("young","old")) Item <- factor(Item.l2_2,levels=c("1&quot...
2013 Mar 14
2
question about nls
Hi,all: I met a problem of nls. My data: x y 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: > nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out the reason for the error. Any suggesions are welcome. Many thanks. [[alternative HTML
2009 Apr 24
1
the puzzle of eigenvector and eigenvalue
...l I am so glad the R can provide the efficient calculate about eigenvector and eigenvalue. However, i have some puzzle about the procedure of eigen. Fristly, what kind of procedue does the R utilize such that the eigen are obtained? For example, A=matrix(c(1,2,4,3),2,2) we can define the eigenvalue lamda, such as det | 1-lamda 4 | =0 | 2 3-lamda | then we can obtain the lamda=5 and -1 however, i am interesting in that how does the R to obatin lamda? By the way, how does the R also obtain the eigenvector? Basically, i must to know those definition in the R becau...
2009 Apr 03
2
Geometric Brownian Motion Process with Jumps
...with jumps. I have create a vector of jumps and then added this into my log-likelihood equation, know I am getting a message: NA in the initial gradient My codes is hear # n<-length(combinedlr) j<-c(1,2,3,4,5,6,7,8,9,10) gbmploglik<-function(param){ mu<-param[1] sigma<-param[2] lamda<-param[3] nu<-param[4] gama<-param[5] logLikVal<- - n*lamda - .5*n*log(2*pi) + sum(log(sum(for(j in 1:10)(cat((lamda^j/factorial(j))*(1/((sigma^2+j*gama^2)^.5)*exp( - (combinedlr-mu-j*nu)^2/2*(sigma^2+j*gama^2)))))))) logLikVal } rescbj<- maxLik(gbmploglik, grad = NULL, hess = NU...
2013 Mar 11
1
Implementation of the PL2 weighting scheme of the DFR Framework
...document frequency normalization H2(2) (as proposed by Amati in his PHD thesis). The formula for w(t,d) in this scheme is given by::- w(t,d) = wqf * L * P where wqf = within query frequency L = Laplace law of after effect sampling =1 / (wdfn + 1) P = wdfn * log (wdfn / lamda) + (lamda - wdfn) log(e) + 0.5 * log (2 * pi * wdfn) wdfn = wdf * (1+c * log(average length of document in database / length of document d )) (H2 Normalization ) lamda = mean of the Poisson distrubution = Collection frequency of the term / Size of the database and the b...
2004 Dec 09
1
How can I estimate parameters of probability distributions?
Hi list, I have a group of data. It looks like they follow a exponential distribution. In R, how can I esimate lamda, that is the rate in pexp, of the distribution and can I use Kolmogorov-Smirnov for hypothesis testing in such a situation? I have read the "8.2 Examing the distribution of a set of data" of "An Introduction to R" but I did not find any clues on this issue. (The data is in the...
2009 Apr 10
1
Re MLE Issues
...ry to create a vector > #GBMPJ MLE Combined Ph 1 LR > # > n<-length(combinedlrph1) > j<-c(1,2,3,4,5,6,7,8,9,10) Error in c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) : unused argument(s) (3, 4, 5, 6, 7, 8, 9, 10) > gbmploglik<-function(param){ + mu<-param[1] + sigma<-param[2] + lamda<-param[3] + nu<-param[4] + gama<-param[5] + logLikVal<- - n*lamda - .5*n*log(2*pi) + sum((for(i in 1:n)(log(sum(for(j in 1:10)(((lamda^j/factorial(j))*(1/((sigma^2+j*gama^2)^.5)*exp( - (combinedlrph1-mu-j*nu)^2/2*(sigma^2+j*gama^2)))))))))) + logLikVal + } > rescbj<- maxLik(gbmplo...
2010 Apr 13
0
Wilks lamda and single discriminant function
Dear R-users, I'm wondering how to obtain Wilks-lambda values when discriminant analyses have only one discriminant function (i.e. 2 categories to discriminate between). The use of manova(predictions~groups, test="Wilks") asks for multiple response and the use of anova(lm(predictions~groups), test="Wilks") simply does not consider the last term. (The alternative
2009 Jul 17
1
attachment_fu :partition => lamda {}
Hi - I am trying to dynamically create my partition folders via attachment_fu. I have read about a hack that allows you to do this on the attachment model: :partition => lambda {|a| a.article_id} Which passes the model''s object into the lambda and uses the ''article_id'' attribute as its directory name. However, this isn''t work for me. I think the lambda
2017 Jun 16
1
Generate correlated expontial distribution -- lamda please guide
Hi, I need to generate correlated (positive as well as negative) bivariate exponential distribution with rate of 1/5 or any rate I need some guidance here. Please help. Regards, Sunny
2000 Mar 01
2
Help please..
...p <- log(z[i]) + q <- log(1 - z[j]) + + r <-(2 * i - 1) * (p + q) + #cat(p+ q, r, '\n') + k <- k + r + #p <- p * (2 * i - 1) + #cat(p, '\n') + } + + k <- - (k / len.gen) + k <- k - len.gen + + k <- (1 + 0.6/len.gen) * k + + return(list(lamda=mean.gen, ad=k)) + #cat(k, '\n') + } > > # The Exponential data from Law & Kelton "Simulation Modeling & Analysis" > # second edition, table 6.7, page 367 (with lamda 0.399) > > kelton <- c(rep(0.01, 8), rep(0.02, 2), rep(0.03, 3), rep(0.04, 6), + rep...
2020 Oct 09
1
Aide pour finaliser ce code
...Xjh bar Xjhbar=list() for (i in 1:q){ w=matrix(0,R[i],p) for (j in 1:R[i]){ w[j,]=colSums(W[[i]][,j]*X)/n11[[i]][j] } Xjhbar[[i]]=w } #calcul des TO jh TO.jh=list() for (i in 1:q){ w=Xjhbar[[i]] to=w*0 for (j in 1:R[i]){ to[j,]=w[j,]-Xbar } TO.jh[[i]]=to } #calcul des Lamda J Lamda=matrix(0,p,p) for (i in 1:q){ to=TO.jh[[i]] w=matrix(0,p,p) for (j in 1:R[i]){ w=w+(P11[[i]][j]*(to[j,]%*%t(to[j,]))) } Lamda=Lamda+w } tr1=n*sum(diag(Lamda)) # Calcul de Gamma GGamma=matrix(0,p*sum(R),p*sum(R)) PGamma=kronecker(diag(P11[[1]]),diag(p)) Ifin=p*R[1] GGamma[...
2020 Oct 10
3
Please need help to finalize my code
...1:q){ 80 w=matrix(0,R[i],p) 81 for (j in 1:R[i]){ 82 w[j,]=colSums(W[[i]][,j]*X)/n11[[i]][j] 83 } 84 Xjhbar[[i]]=w 85 } 86 #calculation of TO jh 87 TO.jh=list() 88 for (i in 1:q){ 89 w=Xjhbar[[i]] 90 to=w*0 91 for (j in 1:R[i]){ 92 to[j,]=w[j,]-Xbar 93 } 94 TO.jh[[i]]=to 95 } 96 #calculation of Lamda J 97 Lamda=matrix(0,p,p) 98 for (i in 1:q){ 99 to=TO.jh[[i]] 100 w=matrix(0,p,p) 101 for (j in 1:R[i]){ 102 w=w+(P11[[i]][j]*(to[j,]%*%t(to[j,]))) 103 } 104 Lamda=Lamda+w 105 } 106 tr1=n*sum(diag(Lamda)) 107 # Gamma Calculation 108 GGamma=matrix(0,p*sum(R),p*sum(R)) 109 PGamma=kronecker(diag(P1...
2020 Oct 13
1
Please need help to finalize my code
...[[i]][j] > 83 } > 84 Xjhbar[[i]]=w > 85 } > > 86 #calculation of TO jh > > 87 TO.jh=list() > 88 for (i in 1:q){ > 89 w=Xjhbar[[i]] > 90 to=w*0 > 91 for (j in 1:R[i]){ > 92 to[j,]=w[j,]-Xbar > 93 } > 94 TO.jh[[i]]=to > 95 } > > 96 #calculation of Lamda J > > 97 Lamda=matrix(0,p,p) > 98 for (i in 1:q){ > 99 to=TO.jh[[i]] > 100 w=matrix(0,p,p) > 101 for (j in 1:R[i]){ > 102 w=w+(P11[[i]][j]*(to[j,]%*%t(to[j,]))) > 103 } > 104 Lamda=Lamda+w > 105 } > > 106 tr1=n*sum(diag(Lamda)) > > 107 # Gamma Calculatio...
2012 Apr 17
3
error using nls with logistic derivative
Hi I?m trying to fit a nonlinear model to a derivative of the logistic function y = a/(1+exp((b-x)/c)) (this is the parametrization for the SSlogis function with nls) The derivative calculated with D function is: > logis<- expression(a/(1+exp((b-x)/c))) > D(logis, "x") a * (exp((b - x)/c) * (1/c))/(1 + exp((b - x)/c))^2 So I enter this expression in the nls function: