Displaying 20 results from an estimated 30000 matches similar to: "generating sets of parameters, when some parameters are vectors"
2010 Oct 04
1
I have aproblem about nomogram--thank you for your help
dear professor:
I have a problem about the nomogram.I have got the result through analysing the dataset "exp2.sav" through multinominal logistic regression by SPSS 17.0.
and I want to deveop the nomogram through R-Projject,just like this :
> n<-100
> set.seed(10)
> T.Grade<-factor(0:3,labels=c("G0", "G1", "G2","G3"))
>
2004 Sep 06
1
A naive lsoda question....
Hello,
I am an R newbie, trying to use lsoda to solve standard
Lotka-Volterra competition equations. My question is: how do I
pass a parameter that varies with time, like say, phix <- 0.7 +
runif(tmax) in the example below.
# defining function
lotvol <- function(t,n,p){
x <- n[1]; y <- n[2]
rx <- p["rx"]; ry <- p["ry"]
Kx <-
2007 Apr 05
1
Plotting multiple curves with lattice graphs
Hi List,
I would like to plot multiple curves (parametric
density curves) in one plot.
For example:
# parameters for three normal density curves
parms =
data.frame(ID=c(1,2,3),mu=c(50,55,60),sigma=c(10,12,15))
# I can easily draw three normal density curves using
curve():
curve(dnorm(x,mean=parms$mu[1],sd=parms$sigma[1]),from=0,
to=150, ylab="density", col="red")
2007 Mar 03
3
How to convert List object to function arguments?
Dear R gurus,
I have a function "goftests" that receives the following arguments:
* a vector "x" of data values;
* a distribution name "dist";
* the dots list ("...") containing a list a parameters to pass to CDF
function;
and calls several goodness-of-fit tests on the given data values against
the given distribution.
That is:
##### BEGIN CODE SNIP #####
2017 Sep 22
0
update numeric values of list with new values...
Solved it:
test <- list(a=1,b=2,c=3)
new <- c(4,5,6)
hold <- as.list(new)
updated_test <- replace(test,c(1:3),hold)
$a
[1] 4
$b
[1] 5
$c
[1] 6
mean.parms <- as.list(mean.parms)
mm.parms <- replace(far.parms,c(1:length(far.parms)),mean.parms)
On 9/22/2017 10:34 AM, Evan Cooch wrote:
> Suppose I have the following:
>
> test <- list(a=1,b=2,c=3)
>
> I
2006 Mar 02
1
Named parameters in optim()
If I name the elements of the vector of initial values passed to
optim(), then it attaches the names to the final result, e.g.
> f <- function(parms) (parms[1]-1)^2+(parms[2]-2)^2
> optim(c(x=3,y=4), f)
$par
x y
0.9999635 2.0003241
$value
[1] 1.063637e-07
$counts
function gradient
65 NA
$convergence
[1] 0
$message
NULL
However, the vector that gets
2009 Sep 24
1
Fw: Re: Multiple Normal Curves
Sorry about the subject
--- On Thu, 24/9/09, KABELI MEFANE <kabelimefane@yahoo.co.uk> wrote:
From: KABELI MEFANE <kabelimefane@yahoo.co.uk>
Subject: Re: [R] Multiply Normal Curves
To: R-help@r-project.org
Date: Thursday, 24 September, 2009, 11:48 AM
R -helpers
i have been trying to do this problem without must success,i managed to do a graph for x, but it is not what i want to
2017 Sep 22
1
update numeric values of list with new values...
Well, that's a bit like driving from Boston to New York by way of Chicago.
See ?structure
test <- list(a=1,b=2,c=3)
new <- c(4,5,6)
test.new <- structure(as.list(new), names=names(test))
test.new
$a
[1] 4
$b
[1] 5
$c
[1] 6
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka
2009 Jan 10
1
Arguments for Rcmd BATCH
Sorry to bother you and I hope this will be easy to solve.
I am trying to run R scripts in batch, called from another programme, under
Windows XP. I have R 2.4.1
I need to be able to pass a list of numeric arguments to the script as well.
The Rscript and its input data file are attached.
I have been trying the syntax below but it doesn't work:
Rcmd BATCH -no-save
2009 Sep 08
1
optim() argument scoping: passing parameter values into user's subfunction
Dear useRs,
I have a complicated function to be optimized with optim(), and whose
parameters are passed to another function within its evaluation. This
function allows for the parameters to enter as arguments to various
probability distribution functions.
However, I am violating some scoping convention, as somewhere within the
hierarchy of calls a variable is not visible. I will give a
2006 Aug 26
1
problems with loop
Dear all,
I am trying to evaluate the optimisation behaviour of a function. Originally
I have optimised a model with real data and got a set of parameters. Now I
am creating simulated data sets based on these estimates. With these
simulations I am estimating the parameters again to see how variable the
estimation is. To this end I have written a loop which should generate a new
simulated data
2005 Mar 28
2
Generating list of vector coordinates
Hi.
Can anyone suggest a simple way to obtain in R a list of vector
coordinates of the following form? The code below is Mathematica.
In[5]:=
Flatten[Table[{i,j,k},{i,3},{j,4},{k,5}], 2]
Out[5]=
{{1,1,1},{1,1,2},{1,1,3},{1,1,4},{1,1,5},{1,2,1},{1,2,2},{1,2,3},{1
,2,4},{1,2,
5},{1,3,1},{1,3,2},{1,3,3},{1,3,4},{1,3,5},{1,4,1},{1,4,2},{1,4,3},
{1,4,
2006 Apr 20
2
nlminb( ) : one compartment open PK model
All,
I have been able to successfully use the optim( ) function with
"L-BFGS-B" to find reasonable parameters for a one-compartment
open pharmacokinetic model. My loss function in this case was
squared error, and I made no assumptions about the distribution
of the plasma values. The model appeared to fit pretty well.
Out of curiosity, I decided to try to use nlminb( ) applied to
a
2005 Jul 19
2
Michaelis-menten equation
Dear R users:
I encountered difficulties in michaelis-menten equation. I found
that when I use right model definiens, I got wrong Km vlaue,
and I got right Km value when i use wrong model definiens.
The value of Vd and Vmax are correct in these two models.
#-----right model definiens--------
PKindex<-data.frame(time=c(0,1,2,4,6,8,10,12,16,20,24),
2010 Dec 06
4
Runif Help: same variable, 3 different parameters
So I am working on an economic model and I need to change the parameters of
the runif statement as time goes on.
Ex.
X <-runif(1:50,0,5)
X <-runif(51:100,100,150)
X <-runif(100:T, 1,2)
Not sure how to go about entering this in to R properly.
--
View this message in context: http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073893p3073893.html
Sent from
2006 Aug 08
1
Fitting data with optim or nls--different time scales
Hi,
I have a system of ODE's I can solve with lsoda.
Model=function(t,x,parms)
{
#parameter definitions
lambda=parms[1]; beta=parms[2];
d = parms[3]; delta = parms[4];
p=parms[5]; c=parms[6]
xdot[1] = lambda - (d*x[1])- (beta*x[3]*x[1])
xdot[2] = (beta*x[3]*x[1]) - (delta*x[2])
xdot[3] = (p*x[2]) - (c*x[3])
return(list(xdot))
}
I want
2013 Feb 21
1
using and event in deSolve
Hi All
Having been pointed the use of events and roots in deSolve, I was able to
implement the Izchikevich model of spiking neurons. However, I'm not too
sure of defining the event. The deSolve documentation says:
An event is triggered when the ball hits the ground (height = 0) Then
velocity (y2) is reversed
and reduced by 10 percent. The root function, y[1] = 0, triggers the event:
>
2006 Jan 20
1
Passing variable arguments to functions
Hi,
Is there another way to pass arguments via a vector to arbitrary functions
as in the following code example without using a series of if else
statements?
f <- test(func, x, parms, fargs1, fargs2, ...)
{
# parms is a vector of parameters to func.
# ... is for use by f, not by func.
n <- length(parms)
if (n == 0) y <- func(x)
else if (n == 1) y <- func(x,
2007 Oct 23
1
How to avoid the NaN errors in dnbinom?
Hi, The code below is giving me this error message:
Error in while (err > eps) { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In dnbinom(x, size, prob, log) : NaNs produced
2: In dnbinom(x, size, prob, log) : NaNs produced
I know from the help files that for dnbinom "Invalid size or prob will
result in return value NaN, with a warning", but I am not able
2012 Mar 23
1
Memory limits for MDSplot in randomForest package
Hello,
I am struggling to produce an MDS plot using the randomForest package
with a moderately large data set. My data set has one categorical
response variables, 7 predictor variables and just under 19000
observations. That means my proximity matrix is approximately 133000
by 133000 which is quite large. To train a random forest on this large
a dataset I have to use my institutions high