similar to: Help with functions as arguments

Displaying 20 results from an estimated 40000 matches similar to: "Help with functions as arguments"

2013 Sep 05
2
Pronósticos con modelos robusto de series de tiempo
Alguien me podría sugerir un paquete en R para generar pronóticos con modelos robusto de series de tiempo.   Saludos Enrique RAMOS [[alternative HTML version deleted]]
2005 Jul 19
2
Regression lines for differently-sized groups on the same plot
Hi there, I've looked through the very helpful advice about adding fitted lines to plots in the r-help archive, and can't find a post where someone has offered a solution for my specific problem. I need to plot logistic regression fits from three differently-sized data subsets on a plot of the entire dataset. A description and code are below: I have an unbalanced dataset
2013 Feb 20
0
Problems with line types in plots saved as PDF files
Ian No differences with Adobe X with the following windows(6,6) #pdf(file = "TestPlot.pdf", 6, 6) #{ plot(b, l, type = "l", ylim = c(y.min, y.max), lwd = 2, xlab = expression(beta), ylab = "", col = "green", yaxt = "n", xaxt = "n") points(b, p, type = "l", lty = "dotted", lwd = 2, col = "red") points(b,
2011 Sep 11
3
(no subject)
Dear all, Can anyone take a look at my program below? There are two functions: f1 (lambda,z,p1) and f2(p1,cl, cu). I fixed p1=0.15 for both functions. For any fixed value of lambda (between 0.01 and 0.99), I solve f1(p1=0.15, lambda=lambda, z)=0 for the corresponding cl and cu values. Then I plug the calculated cl and cu back into the function f2. Eventually, I want to find the lambda value
2002 Jun 05
6
mixing different modes of lty line type specification in legend() ?
Hi List, is sth. like the following possible: legend(x,y,c("A","B","C"), lty=list(1,"42","11")) ? Or: is there a possibility to define a solid line using the "string" mode for lty? Thanks Marcus -- +-------- ><> ------------------------------------------- | E-Mail: eger.m at gmx.de (NEW) | marcus.eger at
2011 Feb 21
1
question about solving equation using bisection method
Hi all, I have the following two function f1 and f2. f1 <- function(lambda,z,p1){ lambda*(p1*exp(-3*z-9/2)+(0.2-p1)*exp(4*z-8))-(1-lambda)*0.8} f2 <- function(p1,cl, cu){ 0.8*(pnorm(cl)+(1-pnorm(cu)))/(0.8*(pnorm(cl)+(1-pnorm(cu)))+p1*(pnorm(cl+3)+(1-pnorm(cu+3)))+(0.2-p1)*(pnorm(cl-4)+(1-pnorm(cu-4))))}-0.05 First fix p1 to be 0.15. (i) choose a lambda value, say lamda=0.6, (ii)
2013 Sep 30
1
[sm.density.compare] scale up y-axis and additional line type
Dear fellows, The two questions are on sm.density.compare(). I compare kernel density estimates of two arrays of data. I'd like to scale up y-axis so that I can show better the differences in y values. English is not my first language so I'll try to explain it. I would like to stretch y-axis a bit longer but not to change the range of y values. How can I do this? Second, I'm
2018 Jan 14
2
consolidate three function into one
Hi Bert, I am sorry to bother you on weekend. I am still struggling on defining a correct function. I first defined the function RFS (see below), then run it by provide the two argument. m52.2cluster <-RFS(inputfile =allinfo_m52, N=2 ) I do not get error message, but no figure displays on screen. I do not know what is going on. Can you help me a little more on this issue? Thank you,
2007 Oct 22
3
Elasticity in Leslie Matrix
Dear R-users, I would like to calculate elasticities and sensitivities of each parameters involved in the following transition matrix: A <- matrix(c( sigma*s0*f1, sigma*s0*f2, s, v ), nrow=2, byrow=TRUE,dimnames=list(stage,stage)) The command "eigen.analysis" avaliable in package "popbio" provides sensibility matrix and elasticity matrix
2010 Jul 22
5
legend in R plot
Hi all, I am have some difficulty with the legend function. I need to add a legend to describe the different line types in a plot. The legend box is small. It did not include sufficient length of each line type to help distinguish the differnt line types. Is there a way to fix this. Thank you Hannah [[alternative HTML version deleted]]
2012 Mar 25
1
Accessing more than two coefficients in a plot
I've successfully plotted (in the plot and abline code below) a simple regression of Lambda1_2 on VV1_2. I then successfully regressed Lambda1_2 on VV1_2, VV1_22 and VV1_212 producing lm2.l. When I go to plot lm2.l using abline I get the warning: "1: In abline(lm2.l, col = "brown", lty = "dotted", lwd = 2) : only using the first two of 4 regression coefficients"
2018 Jan 15
2
consolidate three function into one
Hi Richard, Thank you so much!! I understand the problem now, I assign a name to the "ggsurvplot" object and then add print(fig) at bottom of function definition, now figure gets printed on screen. Ding # function to generate RFS curves RFS <- function( inputfile, N ) { cluster<- survfit(Surv(RFS_days2, OV_Had_a_Recurrence_CODE) ~ clusters, data =
2003 Apr 29
4
thick plot lines
Dear People, In a qqplot I am doing, I get lines/points that are very thick. I've tried setting the lwd variable to 0.1, but it doesn't seem to have any effect. Also, I have set the value of lty to dashed, but I still get dots. The command looks like qqplot(cdf.inv(seq(0,1,length=size),theta,pos,len),empmargdistvec(len,theta,pos,size), xlim=c(-theta,theta), ylim=c(-theta,theta),
2010 Aug 12
3
Plotting one dot in a graph
I'd like to plot a point at the intersection of these two curves. Thanks x <- seq(.2, .3, by = .01) f <- function(x){ x*cos(x)-2*x**2+3*x-1 } plot(x,f(x), type = "l") abline(h = 0)
2012 Nov 12
8
no y-axis
HI @ all, I'm looking for a simple solution to supress the y-axis - but only the drawn scale - not the values. Only the numbers should be displayed. I tried yaxt="n" but there everything of the y-axis is supressed. Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/no-y-axis-tp4649298.html Sent from the R help mailing list archive at Nabble.com.
2009 Jan 14
1
Help with Plot/Legend
Dear R-Users I have 2 questions: Firstly, If I create a matplot and legend for multiple vectors and then tag another vector on using matlines (e.g. a 'total' of all vectors), is there anyway to add the new line to the legend without recreating it? I have created the plot this way because I would like to define the lty and lwd for the 'total' vector so that it can be
2010 May 09
1
lattice: customising panel.segments using groups
Hi, I want to customise the segments on an xyplot. Below is a simple example of what I'm trying to do... #Example dataset x <- c(-0.25, 0.25, 0.8) y <- c(-0.5, 0, 0.75) gp <- c("A", "I", "C") my.data <- cbind.data.frame(x,y,gp) #setting up the parameters to customise the lines with. ltype <- c(1,2,3) env.col <-
2018 Jan 14
0
consolidate three function into one
FAQ 7.22 You must print a ggplot object, for example with print(m52.2cluster) For the FAQ, run the line system.file("../../doc/FAQ") in R on your computer. Open up the resulting filepath in your favorite editor and scroll down to 7.22 On Sun, Jan 14, 2018 at 4:21 PM, Ding, Yuan Chun <ycding at coh.org> wrote: > Hi Bert, > > I am sorry to bother you on weekend. >
2009 Feb 05
1
optimal control, maximization with several variables?
Dear all, I would like to solve the following problem, which can be done with optimal control theory or dynamic programming: max(x,y) a*u1+b*u2+c*f1(u2) s.t. 0<u1<x, 0<u2<f2(x,u2), x'=f3(u1,u2,x) which can be rewritten if optimal control theory should be applied as H=a*u1+b*u2+c*f1(u2)+lambda*(x') s.t. 0<u1<x, 0<u2<f2(x,u2) The maximum principle
2005 Feb 27
2
Help with constrained optimization
Dear all, I need an advice in the following problem. I have to maximize two functions of the form f1(x)=f(y1,x,alpha1,beta1) and f2(x)=(y2,x,alpha2,beta2), the maximization is with respect to alpha1, alpha2, beta1, beta2. I can maximize each function separately using nlm. The problem is that I have to add the constraint of the form g(alpha1)=g(alpha2). The total number of parameters is