[R] Binary decision problem

2007-06-21 Thread Tolga Uzuner
Dear R Users, I am trying to use LP_SOLVE and would appreciate any assistance with the following problem: - I am trying to choose a fixed number of items out of a batch of items: say 100 out of 800 - items have certain characteristics, say characteric A, B and C - I want to maximise the sum of A a

[R] Generating a double-exponential jump diffusion process

2006-11-05 Thread Tolga Uzuner
Dear R Users, Does anyone know of a package which can generate random realisations of a double-exponential jump diffusion process with a drift ? Something where I can specify the likelihoods of an up or a down jump, the drift rate, and the mean size, and get back a vector of realisation of the

[R] Function with upper/lower bound, shift,slope,curvature

2006-06-26 Thread Tolga Uzuner
Dear R Users, I am looking for a function to use within optim s.t. - f(x,a,b,c,d,e) where I am searching over parameter values a,b,c,d,e - a is the lower bound (typically 1) - b is the upper bound (typically 0) - c,d,e give the function a shift, slope and curvature between a and b Any good candid

[R] Generating Correlated Random Variables

2006-06-25 Thread Tolga Uzuner
Dear Fellow R Users, If I have an NxN correlation matrix and want to generate N correlated random variables N(0,1), is there a simply package in R I can use ? Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo

[R] Touch options

2006-06-15 Thread Tolga Uzuner
Hi, Does anyone know a package which prices simple one-touch options, say using Rmetrics ? I want something which simply has a discontinuous payoff if an asset touches a single level. No knock-in or knock-out features. Thanks, Tolga __ R-help@sta

Re: [R] Sending an ESC command to the console from wihtin a script

2006-04-24 Thread Tolga Uzuner
Gabor Grothendieck wrote: >RSiteSearch("clear screen") > >will locate Windows code to send a ctrl-L to the screen that you >can modify. > >On 4/24/06, Tolga Uzuner <[EMAIL PROTECTED]> wrote: > > >>Hi, >> >>Is there a way to send a

[R] Sending an ESC command to the console from wihtin a script

2006-04-24 Thread Tolga Uzuner
Hi, Is there a way to send an ESC command to the console from within a script window, without using the mouse ? Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http:

[R] pnorm2

2006-04-24 Thread Tolga Uzuner
Hi, Has pnorm2 been dropped from sn ? Have some code using it which seems to failt with a new sn update... Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www

[R] Kullback Liebler

2006-04-23 Thread Tolga Uzuner
Dear R Users, Does anyone have an implementation of KL apart from what is in reldist ? Something with flexibility to take in empirical data for two sets, or their CDF or their density, flagged separately for each ? Thanks __ R-help@stat.math.ethz.ch

Re: [R] Numerical Derivatives in R

2006-03-12 Thread Tolga Uzuner
icDeriv(quote(arbfun(x)), "x") >>> >>> >>[1] 9 >>attr(,"gradient") >> [,1] >>[1,]6 >> >> > >However, numericDeriv is not particularly intelligent. It is >effectively doing what Tolga was trying not

Re: [R] Numerical Derivatives in R

2006-03-12 Thread Tolga Uzuner
Thanks Gray, Tolga Gray Calhoun wrote: >Tolga, > >Look at numericDeriv. > > > >>arbfun <- function(x) x^2 >>x <- 3 >>numericDeriv(quote(arbfun(x)), "x") >> >> >[1] 9 >attr(,"gradient") > [,1] >

[R] Numerical Derivatives in R

2006-03-12 Thread Tolga Uzuner
Hi, Suppose I have an arbitrary function: arbfun<-function(x) {...} Is there a robust implementation of a numerical derivative routine in R which I can use to take it's derivative ? Something a bit more than simple division by delta of the difference of evaluating the function at x and x+delt

Re: [R] Problem with scoping a variable value

2006-02-16 Thread Tolga Uzuner
You are a star... that was it. Many thanks, Tolga -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: 16 February 2006 20:24 To: Tolga Uzuner Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Problem with scoping a variable value Without a reproducible example one

[R] Problem with scoping a variable value

2006-02-16 Thread Tolga Uzuner
Hi there, I have a function which has a variable called show as an input: richardson.grad <- function(func, x, d=0.01, eps=1e-4, r=6, show=F){ # do some things if(show) { cat("\n","first order approximations", "\n") print(a.mtr, 12) } #do more things and return }

[R] Gram-Charlier CDF

2006-02-12 Thread Tolga Uzuner
Hi there, Does anyone have something better (read faster) than the following for the CDF of an A-type Gram-Charlier expansion ? Many thanks in advance, Tolga fact <- function (x) gamma(1 + x) gc <- function(w,skew=0,kurtosis=0) # gram-charlier density # to be positive, must respect the const

Re: [R] Powell's Metod

2006-01-15 Thread Tolga Uzuner
s associated with earlier versions of the Nelder-Mead, CG and > BFGS methods implemented in optim() but in each case different > variants have best stood the course of time. > > On Sun, 15 Jan 2006, Tolga Uzuner wrote: > >> Has anyone implemented

[R] Powell's Metod

2006-01-15 Thread Tolga Uzuner
Folks, Has anyone implemented Powell's Method for minimisation in R ? Many thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Problems with integrate

2005-12-10 Thread Tolga Uzuner
Gabor Grothendieck wrote: >integrate returns a list, not just the value. Try integrate(...)$value >See ?integrate for details. > >On 12/10/05, Tolga Uzuner <[EMAIL PROTECTED]> wrote: > > >>Hi, >> >>Having a weird problem with the integrate function.

[R] Problems with integrate

2005-12-10 Thread Tolga Uzuner
Hi, Having a weird problem with the integrate function. I have a function which calculates a loss density: I'd like to integrate it to get the distribution. The loss density function is: lossdensity<-function(p,Beta,R=0.4){ # the second derivative of the PDF # p is the default probability of t

Re: [R] jagged array

2005-07-03 Thread Tolga Uzuner
t; example should be 3.125. > > spencer graves > > Tolga Uzuner wrote: > >> Berton Gunter wrote: >> >> >>> Please read "An Introduction to R" and the help file for "[", where >>> this is >>> explained. If you wa

Re: [R] jagged array

2005-07-02 Thread Tolga Uzuner
Berton Gunter wrote: >Please read "An Introduction to R" and the help file for "[", where this is >explained. If you want to use R, you need to expend effort to learn it. > >-- Bert Gunter > >-Original Message- >From: [EMAIL PROTECTED] >[mailto

[R] jagged array

2005-07-02 Thread Tolga Uzuner
Hi, I have a "jagged array" which looks like this: > res ... [[996]] [1] 1.375 3.375 4.125 4.625 4.875 4.875 6.625 7.125 8.875 [[997]] [1] 1.875 5.125 6.875 7.875 9.875 [[998]] [1] 1.875 5.375 6.625 6.875 8.125 9.375 9.625 [[999]] [1] 1.875 6.875 9.875 [[1000]] [1] 1.875 6.125 6.875 9.375 9.

[R] Specifying the minimum and maximum of x and y-axis in plot

2005-07-02 Thread Tolga Uzuner
Hi, How do I specify the minimum and maximum of the x and y-axis when using plot ? Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-g

RE: [R] Numerical PDE Solver

2005-05-22 Thread Tolga Uzuner
Thanks. I was thinking of something like Crank-Nicolson ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: 21 May 2005 11:53 To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Numerical PDE Solver Tolga Uzuner <[EM

[R] Numerical PDE Solver

2005-05-21 Thread Tolga Uzuner
Is there a package in R which implements numerically solves pde ? Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Suppressing warning messages

2005-05-15 Thread Tolga Uzuner
How do I suppress the following ? Warning messages: 1: the condition has length > 1 and only the first element will be used in: if (strike == forward) atmvol(forward, t, alpha, beta, rho, upsilon) else { 2: the condition has length > 1 and only the first element will be used in: if (x(z) == 0) 1 el

[R] Re: Inverse of the Laplace Transform/Gaver Stehfest algorithm

2005-04-16 Thread Tolga Uzuner
Tolga Uzuner wrote: Tolga Uzuner wrote: Hi there, Is there an implementation of the Gaveh Stehfest algorithm in R somewhere ? Or some other inversion ? Thanks, Tolga Well, at least here is Zakian's algorithm, for anyone who needs it: Zakian<-function(Fs,t){ # Fs is the function to be

[R] Re: Inverse of the Laplace Transform/Gaver Stehfest algorithm

2005-04-16 Thread Tolga Uzuner
Tolga Uzuner wrote: Hi there, Is there an implementation of the Gaveh Stehfest algorithm in R somewhere ? Or some other inversion ? Thanks, Tolga Well, at least here is Zakian's algorithm, for anyone who needs it: Zakian<-function(Fs,t){ # Fs is the function to be inverted and evalua

[R] Inverse of the Laplace Transform/Gaver Stehfest algorithm

2005-04-14 Thread Tolga Uzuner
Hi there, Is there an implementation of the Gaveh Stehfest algorithm in R somewhere ? Or some other inversion ? Thanks, Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://

[R] Re: beta distribution in terms of it's mean and standard deviation

2005-04-10 Thread Tolga Uzuner
Tolga Uzuner wrote: Hi, Is the beta distribution implemented in terms of it's mean and standard deviation, as opposed to alpha and beta, in any R package ? Thanks Tolga Hmm... answering my own question... guess there is no bijection between {alpha,beta} and {mean,variance} which i

[R] Bug in rnorm.sobol, fOptions package

2005-04-10 Thread Tolga Uzuner
I believe there is a bug in rnorm.sobol. Try hist(rnorm.sobol(2300,1200)) and compare to hist(rnorm.pseudo(2300,1200)) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-pro

[R] beta distribution in terms of it's mean and standard deviation

2005-04-10 Thread Tolga Uzuner
Hi, Is the beta distribution implemented in terms of it's mean and standard deviation, as opposed to alpha and beta, in any R package ? Thanks Tolga __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] having problems with constrOptim

2005-04-09 Thread Tolga Uzuner
,-0.050 ,0.002) theta=x ui %*% theta - ci [,1] [1,] 0.400 [2,] 0.200 [3,] 0.200 [4,] 0.950 [5,] 0.002 [6,] -1.400 [7,] -1.200 [8,] -1.200 [9,] -0.950 [10,] -1.002 try ci [1] 0 0 0 -1 0 -1 -1 -1 -1 -1 hth, ingmar On 4/9/05 12:29 PM, "Tolga Uzuner" <[EMAIL PROT

[R] having problems with constrOptim

2005-04-09 Thread Tolga Uzuner
Hi, Am having problems specifying lower and upper constraints in constrOptim... I have a function(x)->f which takes a 5 vector array the constraints on the elements of x are: x[1],x[2],x[3],x[5]>0 x[4]>-1 x[1],x[2],x[3],x[4],x[5]<1 this works: > x [1] 0.400 0.200 0.200 -0.050 0.002