search for: pk1

Displaying 12 results from an estimated 12 matches for "pk1".

Did you mean: p1
2023 Nov 06
2
non-linear regression and root finding
...SID and total HEPES concentration I can calculate accurately the pH if I know 3 pK values for HEPES by finding the single root with uniroot Now, the problem is that there is some disagreement in the literature what is the correct value for the 3 pKs. I know the 3 pK values have the relationship pK1 < pK2 <- pK3 and for the most common formulation of HEPES I know the charge on fully protonated species is 2. Hence I can generate a huge number of pK values from uniform distribution by taking sort(runif(3,-1,9) and make sure there are no ties and then run all those triplets of pK values...
2023 Nov 06
2
non-linear regression and root finding
Thanks a lot! This was amazing. I'm not sure I see how the conditiion pK1 < pK2 < pK3 is enforced? - it comes from the derivation via generalized Henderson-Hasselbalch but perhaps it is not really necessary. Anyway, the use of Vectorize did the trick! Best wishes Troels Den 06-11-2023 kl. 19:19 skrev Ivan Krylov: > ? Mon, 6 Nov 2023 17:53:49 +0100 > Troel...
2023 Nov 07
1
non-linear regression and root finding
Thanks a lot, Berwin. Unfortunately, pK1 may well be negative and as I understand the literature it may be poorly defined as such, and also seems to be at a boundary, since when lower is set to say rep(-4,3) pK1 is returned as -4 while pK2 and pK3 are undisturbed. Perhaps the point is that pK1 is not carrying any information at the pH...
2023 Nov 06
1
non-linear regression and root finding
...HEPESFUNC which delivers charge in the > fluid for known pKs, HEPTOT and SID. Is it possible to have > root-finding in the formula with nls? Sure. Just reformulate the problem in terms of a function that takes a vector of predictors (your independent variable SID) and the desired parameters (pK1, pK2, pK3) as separate arguments and then returns predicted values of the dependent variable (to compare against pHobs): kw <- 1e-14 # I'm assuming pHm <- Vectorize(function(SID, pK1, pK2, pK3) -log10(uniroot(HEPESFUNC,c(1e-20,1),tol=1e-20,maxiter=1e4, HEPTOT=HEPTOT,SID = SID, p...
2023 Nov 07
1
non-linear regression and root finding
G'day Troels, On Mon, 6 Nov 2023 20:43:10 +0100 Troels Ring <tring at gvdnet.dk> wrote: > Thanks a lot! This was amazing. I'm not sure I see how the conditiion > pK1 < pK2 < pK3 is enforced? One way of enforcing such constraints (well, in finite computer arithemtic only "<=" can be enforced) is to rewrite the parameters as: pK1 = exp(theta1) ## only if pK1 > 0 pK2 = pK1 + exp(theta2) pK3 = pk2 + exp(theta3) And then use your opti...
2023 Nov 06
1
non-linear regression and root finding
...uot; parameters from below. Note that nls() can only handle bounds in the "port" algorithm, and the man page rather pours cold water on using that algorithm. Best, JN On 2023-11-06 14:43, Troels Ring wrote: > Thanks a lot! This was amazing. I'm not sure I see how the conditiion pK1 < pK2 < pK3 is enforced? - it comes from the > derivation via generalized Henderson-Hasselbalch but perhaps it is not really necessary. Anyway, the use of Vectorize > did the trick! > > Best wishes > Troels > > Den 06-11-2023 kl. 19:19 skrev Ivan Krylov: >> ? Mo...
2006 May 09
1
2.3.0 problems
...of NULL environment is deprecated 8: use of NULL environment is deprecated ------------------ What is NULL environment? 3. My files: > .First function() { editedOn <- "2006-04-28, 11:08" options(digits=6) pk <- .packages(all = TRUE) su <- substr(pk,1,3) pk1 <- pk[(su=="cwh") & (!is.na(su))] for (ii in pk1[pk1!="cwhmisc" & (sapply(pk1,function(x) !(" " %in% unlist(strsplit(x,NULL)))))]) # to avoid concatenation of names library(ii,character.only=TRUE) pk <- utils::installed.packages() for (ii...
2011 Feb 17
0
S3/S4/NAMESPACE
In one package (pk1) I define some S3 generics and methods. In pk2 I extend the methods to some S4 objects following the description in ?Methods, with setMethod() and setGeneric() either explicit or implicit (tried both). I export the S3 generic and methods from pk1 NAMESPACE and the S4 from pk2. This works, excep...
2011 Jul 27
2
fitting sine wave
...that it has reached the maximum number of Iterations? ? m<-c(-0.2061826,0.5888406,0.2026079,1.0000000,0.2342754,0.6865078,-0.1265754) x <- c(1,2,3,4,5,6,7) p <- nls(m~k1*x+k2*cos(x)+k3*sin(x)+k4*cos(2*x)+k5*sin(2*x)+k6*cos(3*x),start = list(k1=0,k2=0,k3=0.1,k4=0.1,k5=0,k6=0)) par ?<- c(pk1=summary(p)$parameters[1,1],pk2=summary(p)$parameters[2,1],pk3=summary(p)$parameters[3,1],pk4=summary(p)$parameters[4,1],pk5=summary(p)$parameters[5,1],pk6=summary(p)$parameters[6,1]) xx <- seq(1,7,length.out=500) mm <- par[1]*xx+par[2]*cos(xx)+par[3]*sin(xx)+par[4]*cos(2*xx)+par[5]*sin(2*xx)+...
2009 Nov 02
2
a prolem with constrOptim
...n = data[(1+4*(i-1)):(4*i)] p = theta[(1+3*(i-1)):(3*i)] P = 1-sum(p) S[(1+3*(i-1)):(3*i)] = n[1:3]/p-n[4]/P } S } #where theta=(p11,p12,p13,p21,p22,p23,...,pK1,pK2,pK3). #The function Rmat calculates the restriction matrix needed for constrained estimation Rmat = function(k) { R = matrix(1,4,3) R[1,2] = R[1,3] = R[2,3] = R[3,2] = 0 RR = cbind(-R,R) RRR = matrix(0,4*(k-1),3*k)...
2009 Jan 04
3
Table associated problem using belongs_to
I have two tables: Table [packages] id name user_name ------------------- 1 PK1 Ray ------------------- Table [users] id name full_name ------------------- 2 Ray Ray Sun ------------------- My purpose is to find the full name when I find packages. So I modify Model Package to: class Package < ActiveRecord::Base belongs_to :user, :class_name => &...
2007 Aug 23
6
Saving ActiveRecord in PostgreSQL without id
I have a small table that is used to temporarily queue requests, as such it does not have an id field (or any other primary key), because it doesn''t make sense to have one. When I created an ActiveRecord class and tried to save it, I get: ActiveRecord::StatementInvalid: PGError: ERROR: relation "temp_requests_id_seq" does not exist It keeps looking for the id to auto