Displaying 20 results from an estimated 30000 matches similar to: "Adding "sum" to derivatives table"
2006 Mar 17
1
Derivative of a splinefun function.
Is there a way of calculating the derivative of a function returned
by splinefun()? Such a function is a cubic spline, whence it has a
calculable derivative, but is there a (simple) way of getting at it?
One workaround that I have thought of is to take a fine grid of
points, evaluate the function returned by splinefun() at these
points, put an interpolating spline through these points using
2012 Nov 15
1
create function to solve derivative
Readers,
A data set comprises
A B C
10 6 .2
20 7 .4
30 8 .16
40 9 .0256
My requirement is to obtain the derivative for values of A with
respect to B, create a function in R and plot this derivative against
another variable (e.g. values in column C).
Have searched the mailing list and found reference to a function 'D',
but the help accessed via '?D' and '?deriv' does not
2009 Oct 29
4
deriv() to take vector of expressions as 1st arg?
The deriv() function takes an 'expression' as its first argument). I was
wondering if the this function can take an array or a vector of
expressions as its first argument. Aside, I saw how to give a vector
argument to the second argument.
like to have something like:
deriv(c(~x^2+y^3, ~x^5+y^6), c("x","y"))
the documentation for this function talks about being able to
2006 Oct 02
3
How can I generate this numbers
Hi wizards, I need to know how can I generate this numbers
I have n numbers N1,N2 , Nn , but Nn = 1- sum(N1+N2+...+Nn-1) and
sum(N1+N2+..Nn)=1
and N1,N2,..Nn with 0<N<1 .
Does somebody know how to generate it ? Some distribution or algorithm.
Thanks in advance.
--
Web Page
http://www.geocities.com/ricardo_rios_sv/index.html
2006 Nov 25
3
OT: P(Z <= -1.46).
In checking over the solutions to some homework that I had assigned I
observed the fact that in R (version 2.4.0) pnorm(-1.46) gives
0.07214504. The tables in the text book that I am using for the
course give the probability as 0.0722.
Fascinated, I scanned through 5 or 6 other text books (amongst the
dozens of freebies from publishers that lurk on my shelf) and found
that some agree with R
2007 Apr 03
3
Referencing function name from within function
Hello,
For verbose coding I'd like to do something like:
> myfunction <- function(x){
> if (a){
> stop(paste(myfunction_name_here,"requires xyz!")
> }
Is that possible?
Thanks for any hints, Joh
2006 May 17
3
Off topic --- help in locating a source.
Apologies for the off-topic question; as usual I'm trying to draw
upon the unparalleled knowledge and sagacity of the r-help list.
Please reply off-list if you can help me out.
A collaborator of mine found a formula we need, on sheets which he had
photocopied out of a book, some years ago. He cannot remember which
book (he's getting to be as senile and forgetful as I am, poor
bloke!).
2007 Apr 20
1
Estimating a Normal Mixture Distribution
Hi everyone,
I am using R 2.4.1 on a MacOS X ("Tiger") operating system. In the
last few day I was trying to estimate the parameters of a mixture of
two normal distributions using Maximum Likelihood.
The code is from Modern Applied Statistics with S (4th edition),
chapter 16 ("Optimization"), the dataset is available under MASS in
R. Unfortunately, when I tried out the
2003 May 11
1
Prime or dash in plotmath().
I've had to struggle a bit to get the prime/dash derivative notation
into a plotmath expression. The use of
expression(K'(t))
gives me a syntax error. The best I've been able to come up with is
expression(paste(K,"'",(t),sep=""))
Is this the ``accepted'' procedure, or is there a more direct route?
cheers,
Rolf Turner
rolf at
2004 Mar 01
6
How to plot Histogram with frequence overlaid by distribution curve
Hi,
I am facing the problem that I want to plot a histogram chart set
freq to true and overlay with normal or weibull or exponential distribution
curve.
The sample code is shown as below:
>samp<-c(-8.2262,-8.2262,-8.2262,-8.20209,-8.09294,-8.07321,-8.07321,
-8.07321,-8.07175,-8.04948,-8.04948,-8.04948,-8.03848,-8.03848,
2004 Jul 06
2
Re: errors in randomization test
Colin Bleay wrote:
> last week i sent an e-mail about dealing with errors thrown up from a
> glm.nb model carried out on multiple random datasets.
>
> every so often a dataset is created which results in the following error
> after a call to glm.nb:
>
> "Error: NA/NaN/Inf in foreign function call (arg 1)
> In addition: Warning message:
> Step size truncated due
2017 Feb 17
1
Wish List: Extensions to the derivatives table
The issue is that without an extensible derivative table or the proposed extensions, it is not possible to automatically produce (without manual modification of the deriv3 output) a function that avoids catastrophic cancellation regardless of the working range.
Manual modification is not onerous as a one-time exercise, but can be time consuming when it must be done numerous times, for example
2005 Jun 02
2
Caution on the use of model.matrix.
I have just been bitten by a quirk in the behaviour of model.matrix.
I used model.matrix inside a function, and passed to it a formula
that was built elsewhere.
The formula was of the form ``y ~ x + w + z''. Now, model.matrix
cheerfully accepts formulae of this form, although it only
***needs*** the right hand side, i.e. ``~ x + w + z'' --- the ``y''
can be dropped (but
2004 Dec 04
9
Excel *.xls files, RODBC
I gather from reading the back-issues of r-help that it should be
possible (modulo a number of caveats) to read an excel (yuck!) file
into R using RODBC. I have obtained and installed ODBC and the RODBC
package, but cannot for the life of me figure out how to go about
it. Can anyone give me a simple recipe?
I have an excel file on cdrom, say:
/mnt/cdrom/melvin.xls
I have started R and loaded
2006 May 21
3
normality testing with nortest
I don't know from the nortest package, but it should ***always***
be the case that you test hypotheses
H_0: The data have a normal distribution.
vs.
H_a: The data do not have a normal distribution.
So if you get a p-value < 0.05 you can say that
***there is evidence***
(at the 0.05 significance level) that the data are not from a
normal distribution.
If the nortest package does
2006 Mar 23
3
Intercepts in linear models.
A colleague asked me if there is a way to specify with a
***variable*** (say ``cflag'') whether there is an intercept in a
linear model.
She had in mind something like
lm(y ~ x - cflag)
where cflag could be 0 or 1; if it's 0 an intercept should
be fitted, if it's 1 then no intercept.
This doesn't work ``of course''. The cflag just gets treated
as another predictor
2004 Sep 15
2
Slightly off-topic --- distribution name.
I've built R functions to ``effect'' a particular distribution, and
would like to find out if that distribution is already ``known'' by
an existing name. (I.e. suppose it were called the ``Melvin''
distribution --- I've built dmelvin, pmelvin, qmelvin, and rmelvin as
it were, but I need a real name to substitute for melvin.)
The distribution is really just a toy
2004 May 12
4
missing values imputation
What R functionnalities are there to do missing values imputation (substantial proportion of missing data)?
I would prefer to use maximum likelihood methods ; is the EM algorithm implemented? in which package?
Thanks
Anne
----------------------------------------------------
Anne Piotet
Tel: +41 79 359 83 32 (mobile)
Email: anne.piotet@m-td.com
2006 Oct 10
4
generate random numbers that sum up to 1
As I have previously asked, in response to a similar
question: Is this a homework problem?
cheers,
Rolf Turner
rolf at math.unb.ca
2006 May 29
2
newbie question: ROW average
Dimitris Rizopoulos wrote:
> look at ?rowMeans; you can also use "apply(mat, 1, mean)" but
> rowMeans() is better.
By my reading of the question, this is not what
Ezhil wants. He said:
``I have a 992 x 74 matrix. I would like to form a new matrix
by averaging each 4 rows from the original one.''
I.e. he wants (I think) the first row of the new matrix
to be the