Displaying 20 results from an estimated 1200 matches similar to: "FW: For loop"
2009 Nov 02
1
need help in using Hessian matrix
Hi
I need to find the Hessian matrix for a complicated function from a certain
kind of data but i keep getting this error
Error in f1 - f2 : non-numeric argument to binary operator
the data is given by
U<-runif(n)
Us<-sort(U)
tau1<- 2
F1tau<- pgamma((tau1/theta1),shape,1)
N1<-sum(Us<F1tau)
X1<- Us[1:N1]
2008 Jun 27
3
For loop
Hi,
Could you please let me know to use a list in a for loop here geneset is a
loop.I am trying to match the names of the list with 1st row of the output.
result<- list()
for(i in 1:length(output)
{
result[[i]] <- geneset(which(geneset %n% output[,1]))
}
Kindly help me out
--
View this message in context: http://www.nabble.com/For-loop-tp18163665p18163665.html
Sent from the R
2008 Jul 26
4
parametric bootstrap
Hi
I am trying to find a parametric bootstrap confidence interval and when I used the boot function I get zero bias and zero st.error? What could be my mistake?
Thank you and take care.
Laila
[[alternative HTML version deleted]]
2009 Nov 01
2
intigrate function and absolute error
Hi
Can we get the result of an intigration without the absolute error?
for example
f1<-function(x1){(1/gamma(alpha))*x1^(alpha-1)*exp(-x1)*log(x1)}
I1<-integrate(f1, 0, (max(cc)-tau1+(theta2/theta1)*tau1)/theta2)
I1
0.08007414 with absolute error < 7.2e-05
I need the answer 0.08007414 withou the other part(with absolute error
<7.2e-05)
how can we do that?
thank you and take care
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Oh, sorry; I changed signs in the model, fitting
theta0 + theta1*exp(theta2*x)
So for theta0 - theta1*exp(-theta2*x) use theta1= -.exp(-1.8) and theta2 =
+.055 as starting values.
-- Bert
On Sun, Aug 20, 2023 at 11:50?AM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you so much for your kind and valuable feedback. I tried finding the
> starting
2008 Nov 26
1
Finding Stopping time
Can any one help me to solve problem in my code? I am actually trying to
find the stopping index N.
So first I generate random numbers from normals. There is no problem in
finding the first stopping index.
Now I want to find the second stopping index using obeservation starting
from the one after the first stopping index.
E.g. If my first stopping index was 5. I want to set 6th observation from
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you for your extremely valuable feedback. Now, I just want to
understand why the signs for those starting values, given the following:
> #Fiting intermediate model to get starting values
> intermediatemod <- lm(log(y - .37) ~ x, data=mod14data2_random)
> summary(intermediatemod)
Call:
lm(formula = log(y - 0.37) ~ x, data = mod14data2_random)
Residuals:
Min
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Basic algebra and exponentials/logs. I leave those details to you or
another HelpeR.
-- Bert
On Sun, Aug 20, 2023 at 12:17?PM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you for your extremely valuable feedback. Now, I just want to
> understand why the signs for those starting values, given the following:
> > #Fiting intermediate model to get
2012 Jul 12
0
Generate random numbers with nested Archimedean Copula
Hi everybody,
I try to simulate random numbers from a trivariate nested Archimedean
copula. My aim is to correlate two processes with, e.g. theta2, as the so
called child pair and then to correlate these two processes with a third one
with theta1 (parent). This "figure" tries to capture what I am explaining
theta1
theta2
2023 Aug 20
2
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you so much for your kind and valuable feedback. I tried finding the
starting values using the approach you mentioned, then did the following to
fit the nonlinear regression model:
nlregmod2 <- nls(y ~ theta1 - theta2*exp(-theta3*x),
start =
list(theta1 = 0.37,
theta2 = exp(-1.8),
theta3 =
2011 Feb 21
0
Function within functions and MLE
Hi,
I am trying to determine the MLE of the following function:
http://r.789695.n4.nabble.com/file/n3317341/untitled.bmp
I have defined both parts of the equation as separate functions and looped
over the t and G values to get summations of each part.
The lamda function has 3 unknowns which I am trying to determine using MLE
bub tin order to try and get the overall function working these
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
I got starting values as follows:
Noting that the minimum data value is .38, I fit the linear model log(y -
.37) ~ x to get intercept = -1.8 and slope = -.055. So I used .37,
exp(-1.8) and -.055 as the starting values for theta0, theta1, and theta2
in the nonlinear model. This converged without problems.
Cheers,
Bert
On Sun, Aug 20, 2023 at 10:15?AM Paul Bernal <paulbernal07 at
2007 Sep 12
1
enquiry
Dear R-help,
I am trying to estimate a Cox model with nested effects basing on the
minimization of the overall AIC; I have two frailties terms, both gamma
distributed. There is a error message (theta2 argument misses) and I
don?t understand why. I would like to know what I have wrong. Thank you
very much for your time.
fitM7 <- coxph(Surv(lifespan,censured) ~ south + frailty(id,
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
2011 May 23
0
Error in backSpline.npolySpline(sp) : spline must be monotone
I get the following error:
Error in backSpline.npolySpline(sp) : spline must be monotone
Has anyone had this error before? any ideas on a workaround?
>
> vols=read.csv(file="C:/Documents and Settings/Hugh/My
> Documents/PhD/Swaption vols.csv"
+ , header=TRUE, sep=",")
> X<-ts(vols[,2])
> #X
>
>
> dcOU<-function(x,t,x0,theta,log=FALSE){
+
2008 Apr 22
2
optimization setup
Hi, here comes my problem, say I have the following functions (example case)
#------------------------------------------------------------
function1 <- function (x, theta)
{a <- theta[1] ( 1 - exp(-theta[2]) ) * theta[3] )
b <- x * theta[1] / theta[3]^2
return( list( a = a, b = b )) }
#-----------------------------------------------------------
function2<-function (x, theta)
{P
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
Dear friends,
This is the dataset I am currently working with:
>dput(mod14data2_random)
structure(list(index = c(14L, 27L, 37L, 33L, 34L, 16L, 7L, 1L,
39L, 36L, 40L, 19L, 28L, 38L, 32L), y = c(0.44, 0.4, 0.4, 0.4,
0.4, 0.43, 0.46, 0.49, 0.41, 0.41, 0.38, 0.42, 0.41, 0.4, 0.4
), x = c(16, 24, 32, 30, 30, 16, 12, 8, 36, 32, 36, 20, 26, 34,
28)), row.names = c(NA, -15L), class =
2008 Apr 22
4
how to convert non numeric data into numeric?
I am having the following error in my function
function(theta,reqdIRR)
{
theta1<-theta[1]
theta2<-theta[2]
n<-length(reqdIRR)
constant<- n*(theta1+theta2)
sum1<-lapply(reqdIRR*exp(theta1),FUN = sum)
sum2<-lapply(exp(theta2 - reqdIRR*exp(theta1)),FUN = sum)
sum = sum1 + sum2
log.fcn = constant - as.numeric(sum)
result = - log.fcn
return(result)
}
*error :
2010 Nov 12
1
Problem retrieving data from R2InBUGS
Dear list
I am calling the functiton bugs() provided by R2WinBugs to performs an IRT analysis. The function returns a set of estimated parameters over n replications/iterations. For each replication, two sets of person measures (theta1 and theta2) and two sets of item difficulty parameters (diff1 and diff2) are returned. The code used to obtain these estimates is as follows:
sim <-
2007 Jul 26
3
substituting dots in the names of the columns (sub, gsub, regexpr)
Dear R users,
I have the following two problems, related to the function sub, grep,
regexpr and similia.
The header of the file(s) I have to import is like this.
c("y (m)", "BD (g/cm3)", "PR (Mpa)", "Ks (m/s)", "SP g./g.", "P
(m3/m3)", "theta1 (g/g)", "theta2 (g/g)", "AWC (g/g)")
To get rid of spaces and