Re: [R] lmom package - Resending the email

2014-12-04 Thread Katherine Gobin
r understanding of differing values it makes sense to provide the list at least with an online description of the corresponding functions used in Minitab and SPSS… > > Best > Simon > On 03 Dec 2014, at 10:45, Katherine Gobin via R-help wrote: > >> Dear R forum >>

[R] lmom package - Resending the email

2014-12-03 Thread Katherine Gobin via R-help
Dear R forum I sincerely apologize as my earlier mail with the captioned subject, since all the values got mixed up and the email is not readable. I am trying to write it again.  My problem is I have a set of data and I am trying to fit some distributions to it. As a part of this exercise, I nee

[R] lmom package

2014-12-03 Thread Katherine Gobin via R-help
Dear R Forum I have a set of data say as given below and as an exercise of trying to fit statistical distribution to this data, I am estimating parameters.  amounts =   c(38572.5599129508,11426.6705314315,21974.1571641187,118530.32782443,3735.43055996748,66309.5211176106,72039.2934132668,21934.884

Re: [R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Katherine Gobin
Dear Mr Michael, Thanks a lot for your guidance. The pdf file describing VGAM package has mentioned 'frechet' in the example, so I got the error. Regards Katherine On Thursday, 6 November 2014 2:54 PM, Michael Dewey wrote: On 06/11/2014 06:04, Katherine Gobin wrote: >

[R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Katherine Gobin
Dear R forum, I am trying to execute following code (Page no 259 - VGAM.pdf) # . library(VGAM) set.seed(123) fdata <- data.frame(y1 = rfrechet(nn <- 1000, shape = 2 + exp(1))

[R] Paper on Analytics using R

2014-07-10 Thread Katherine Gobin
Dear R Forum, I am looking for some write-up or paper on Use of R for Analytics or why R should be preferred over others for Analytics purpose. Tried google but got some info about some commercial vendors using R for analytics. I am looking for some paper where no commercial flavor is given, I

[R] Splitting vector elements

2014-05-21 Thread Katherine Gobin
Dear R forum I have a vector as  dat = c("ABC 1", "ABC 2", "ABC 3", "DEF 10", "DEF 20") > dat [1] "ABC 1"  "ABC 2"  "ABC 3"  "DEF 10" "DEF 20" I need to split the names into two parts say    p1      p2  ABC    1  ABC    2  ABC    3  DEF     10  DEF     20 Kindly guide Katherine [[al

[R] R equivalent functions of some EXCEL functions

2014-05-14 Thread Katherine Gobin
Dear R forum, EXCEL has some standard functions e.g.  (1) PRICE function : Returns the price per $100 face value of a security that pays periodic interest. (2) COUPDAYBS : Returns the number of days from the beginning of the coupon period to the settlement date. (3) COUPDAYS : Returns the

[R] Conditional subtraction

2014-04-07 Thread Katherine Gobin
Dear R forum I have following data.frame dat = data.frame(key = c("A", "B", "C", "D", "E", "E"), id = c("instru_A", "instru_B", "instru_B", "instru_B", "instru_C", "instru_C"), price = c(101.38, 3.9306, 3.7488, 92.9624, 5.15, 96.1908), adj_factor = c(2.08, 2.5217, 2.5217, 2.5217, 3.08, 3.08))

Re: [R] How to store interim print results

2014-04-03 Thread Katherine Gobin
, ncol = 2, byrow = TRUE) >  > report      [,1]         [,2] [1,] "2015-10-01" "1"  [2,] "2015-04-01" "2"  [3,] "2014-10-01" "3"  [4,] "2014-04-01" "4"  >  >  Jim Holtman Data Munger Guru   What is

Re: [R] How to store interim print results

2014-04-03 Thread Katherine Gobin
s) # store the cashflow numbers    cashflow.nos <- append(cashflow.nos, cashflows) } output.dat <- data.frame(cashflow.tenure, cashflow.nos) output.dat Jean On Thu, Apr 3, 2014 at 5:22 AM, Katherine Gobin wrote: Dear R forum, > >Following is an customized extract of a code I am

[R] How to store interim print results

2014-04-03 Thread Katherine Gobin
Dear R forum, Following is an customized extract of a code I am working on. settlement = as.Date("2013-11-25") maturity   = as.Date("2015-10-01") coupon     = 0.066 yield      = 0.1040 basis      = 1   frequency = 2 redemption = 100 # _

[R] Running the Loop

2014-02-04 Thread Katherine Gobin
Dear R forum, I have following data.frames dat = data.frame(id = c(1:3), root = c(0.10, 0.20, 0.74), maturity_period = c(20, 155, 428), mtm = c(1000, 1, 10), curve = c("USD", "USD", "USD")) > dat   id root maturity_period   mtm curve 1  1 0.10              20 1e+03   USD 2  2 0.20    

Re: [R] Reversing the Equation to find value of variable

2014-01-06 Thread Katherine Gobin
to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Katherine Gobin > Sent: 6. januar 2014 12:42 > To: r-h

[R] Reversing the Equation to find value of variable

2014-01-06 Thread Katherine Gobin
Dear R forum I have following variables - EAD = 1 LGD = 0.45 PD = 0.47 M = 3 # Equation 1 R = 0.12*(1-exp(-50*PD))/(1-exp(-50)) + 0.24*(1-(1-exp(-50*PD))/(1-exp(-50))) b = (0.11852 - 0.05478 * log(PD))^2 K = (LGD * pnorm((1 - R)^(-0.5) * qnorm(PD) + (R / (1 - R))^0.5 * qnorm(0.999)) - PD

[R] Readjusting frequencies

2013-11-11 Thread Katherine Gobin
Dear Forum, I have following data.frame as fraud_data = data.frame(no_of_frauds = c(1, 2, 4, 6, 7, 9, 10), frequency = c(3, 1, 7, 11, 13, 1, 4)) > fraud_data   no_of_frauds frequency 1            1         3 2            2         1 3            4         7 4            6        11 5          

[R] Yield to maturity in R

2013-10-30 Thread Katherine Gobin
Dear R forum, Just want to know if there is any function / package in R which will calculate Yield to Maturity in R for a given bond? Regards Katherine [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.eth

Re: [R] Subseting a data.frame

2013-10-18 Thread Katherine Gobin
vel, NA generated > >    3: In `[<-.factor`(`*tmp*`, i, value = 1L) : > >      invalid factor level, NA generated > > but x=integer(length(group)) works in all cases: > >    > ave(integer(length(fac)), fac, FUN=length) > >    [1] 3 1 3 3 > >    > ave(in

Re: [R] Subseting a data.frame

2013-10-17 Thread Katherine Gobin
class 8, I alpologize for the incovenience. Regards KAtherine On , Katherine Gobin wrote:  I am sorry perhaps  was not able to put the question properly. I am not looking for the subset of the data.frame where the basel_asset_class is > 2. I do agree that would have been a ba

Re: [R] Subseting a data.frame

2013-10-17 Thread Katherine Gobin
warm regards Katherine Gobin On Thursday, 17 October 2013 9:33 PM, Bert Gunter wrote: "Kindly guide" ... This is a very basic question, so the kindest guide I can give is to read an Introduction to R (ships with R) or a R web tutorial of your choice so that you can learn

[R] Subseting a data.frame

2013-10-17 Thread Katherine Gobin
Dear Forum, I have a data frame as  mydat = data.frame(basel_asset_class = c(2, 8, 8 ,8), defa_frequency = c(0.15, 0.07, 0.03, 0.001)) > mydat   basel_asset_class defa_frequency 1                 2          0.150 2                 8          0.070 3                 8          0.030 4          

Re: [R] How to write an error to output

2013-10-16 Thread Katherine Gobin
olve? Tell me what you want to do, not how you want to do it. On Wed, Oct 16, 2013 at 7:01 AM, Katherine Gobin wrote: > Dear R forum, > > The example below is just an indicative one and I have constructed it. My > real life data and conditions are different. > > I have a data.fr

[R] How to write an error to output

2013-10-16 Thread Katherine Gobin
Dear R forum, The example below is just an indicative one and I have constructed it. My real life data and conditions are different. I have a data.frame as given below mydat = data.frame(A = c(19, 20, 19, 19, 19, 18, 16, 18, 19, 20), B = c(19, 20, 20, 19, 20, 18, 19, 18, 17, 16)) if (length(m

[R] Double return statement

2013-08-14 Thread Katherine Gobin
Dear R forum, I have a function which generates say two outputs, say output_1 and output_2. Output_1 is a single row output whereas Output_2 is a dataframe having multiple records. Is it possible to use two return statements in function. Output_2 uses some records from output_1, hence I need to

[R] Choosing subset of data.frame

2013-06-20 Thread Katherine Gobin
Dear R Forum I have a data frame as beta_results = data.frame(instrument = c("ABC", "DEF", "JKL",  "LMN", "PQR", "STU", "UVW", "XYZ"), beta_values = c(1.27, -0.22, 0.529, 0.011, 2.31, -1.08, -2.7, 0.42)) > beta_results   instrument beta_values 1    ABC   1.270 2    DEF  -0.220

[R] Removing "NA" from matrix

2013-06-14 Thread Katherine Gobin
Dear R forum, I have a data frame dat = data.frame( ABC = c(25.28000732,48.33857234,19.8013245,10.68361461), DEF = c(14.02722251,10.57985168,11.81890316,21.40171514), GHI = c(1,1,1,1), JKL = c(45.96423231,44.52986236,16.56514176,32.14545122), MNO = c(45.38438063,15.54338206,18.78444777,24.29486

[R] Finding Beta

2013-06-04 Thread Katherine Gobin
Dear R forum I have a dataframe (of prices) as given below - dat = data.frame(company = rep(c("A", "B", "C", "D", "index"), each = 5), prices = c(runif(5, 10, 12), runif(5, 108, 112), runif(5, 500, 510), runif(5, 40, 50), runif(5, 1000, 1020)))    company prices 1    A   10.61727 2   

Re: [R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0

2013-05-02 Thread Katherine Gobin
along-with Rcpp. Regards Katherine   --- On Thu, 2/5/13, Prof Brian Ripley wrote: From: Prof Brian Ripley Subject: Re: [R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0 To: "Katherine Gobin" Cc: r-help@r-project.org Date: Thursday, 2 May, 2013, 1:23

[R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0

2013-05-02 Thread Katherine Gobin
Dear Forum, I have R version 3.0.0 installed and need to install RQuantLib pacakge. I tried to install it from CRAN Mirror and I couldn't load it. I had saved the package i zip format and tried to install it locally but I am getting following error. > utils:::menuInstallLocal() Error in read.d

[R] Adding elements in data.frame subsets and also subtracting an element from the rest elements in data.frame

2013-04-29 Thread Katherine Gobin
Dear R forum I have a data.frame as cashflow_df = data.frame(instrument = c("ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC", "ABC", "PQR", "PQR", "PQR","PQR","PQR","PQR","PQR","PQR","PQR","PQR", "PQR", "PQR", "PQR","PQR", "PQR","PQR","PQR","PQR", "PQR","PQR"

[R] Splitting data.frame and saving to csv files

2013-04-26 Thread Katherine Gobin
Dear R Forum, I have a data.frame as df = data.frame(date = c("2013-04-15", "2013-04-14", "2013-04-13", "2013-04-12", "2013-04-11"), ABC_f = c(62.80739769,81.04525895,84.65712455,12.78237251,57.61345256), LMN_d = c(21.16794336,54.6580401,63.8923307,87.59880367,87.07693716), XYZ_p = c(55.8885464,

Re: [R] Linear Interpolation : Missing rates

2013-04-25 Thread Katherine Gobin
: "Katherine Gobin" Cc: "R help" Date: Thursday, 25 April, 2013, 2:23 PM Katherine, Split the rate names into their currency and tenor parts and assign a numeric value to each tenor.  Choose a model to do your approximations (I used linear regression in the example below)

[R] Linear Interpolation : Missing rates

2013-04-24 Thread Katherine Gobin
Dear R forum I have data.frame as df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m",  "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1m", "GBP_1m", "GBP_1m", "GBP_1m", "GBP_2m", "GBP_2m", "GBP_2m",

[R] Fw: " PROBLEM SOLVED" - Error with function

2013-04-22 Thread Katherine Gobin
to all for consuming your valuable time. Thanks for the efforts at your end. Regards Katherine --- On Tue, 23/4/13, Katherine Gobin wrote: From: Katherine Gobin Subject: [R] Error with function To: r-help@r-project.org Date: Tuesday, 23 April, 2013, 7:06 AM Dear R forum, I have a data.fram

[R] Fw: Error with function - USING library(plyr)

2013-04-22 Thread Katherine Gobin
Dear R forum, Please refer to my query regarding "Error with function". I forgot to mention that I am using "plyr" library. Sorry for inconvenience. Regards Katherine --- On Tue, 23/4/13, Katherine Gobin wrote: From: Katherine Gobin Subject: [R] Error with f

[R] Error with function

2013-04-22 Thread Katherine Gobin
Dear R forum, I have a data.frame as given below: df = data.frame(tran = c("tran1", "tran2", "tran3", "tran4"), tenor = c("2w", "1m", "7m", "3m"))  Also, I define libor_tenor_labels = as.character(c("o_n", "1w", "2w", "1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m", "11m", "12m"

Re: [R] Creating a vector with repeating dates

2013-04-17 Thread Katherine Gobin
Dear Sir, Thanks a lot for your valuable suggestions and help. Regards Katherine --- On Wed, 17/4/13, Jim Lemon wrote: From: Jim Lemon Subject: Re: [R] Creating a vector with repeating dates To: "Katherine Gobin" Cc: r-help@r-project.org Date: Wednesday, 17 April, 2013, 10:35

Re: [R] Creating a vector with repeating dates

2013-04-17 Thread Katherine Gobin
? Regards Katherine --- On Wed, 17/4/13, andrija djurovic wrote: From: andrija djurovic Subject: Re: [R] Creating a vector with repeating dates To: "Katherine Gobin" Cc: "r-help@r-project.org" Date: Wednesday, 17 April, 2013, 10:14 AM ?rep On Wed, Apr 17, 2013 at 11:

[R] Creating a vector with repeating dates

2013-04-17 Thread Katherine Gobin
Dear R forum I have a data.frame df = data.frame(dates = c("4/15/2013", "4/14/2013", "4/13/2013", "4/12/2013"), values = c(47, 38, 56, 92)) I need to to create a vector by repeating the dates as "Current_date", 4/15/2013, 4/14/2013, 4/13/2013, 4/12/2013,  "Current_date", 4/15/2013, 4/14/2013

[R] Splitting the Elements of character vector

2013-04-16 Thread Katherine Gobin
Dear R forum I have a data.frame df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))   currency_type rates 1  EURO_o_n   0.470 2  EURO_o_n   0.475 3

Re: [R] Sorting data.frame and again sorting within data.frame

2013-04-16 Thread Katherine Gobin
Dear Sir, Thanks a lot for your valuable input and guidance. Regards Katherine --- On Mon, 15/4/13, Jeff Newmiller wrote: From: Jeff Newmiller Subject: Re: [R] Sorting data.frame and again sorting within data.frame To: "David Winsemius" , "Katherine Gobin" Cc: r-hel

[R] Sorting data.frame and again sorting within data.frame

2013-04-14 Thread Katherine Gobin
Dear R forum, I have a data.frame as defied below - df = data.frame(names = c("C", "A", "A", "B", "C", "B", "A", "B", "C"), dates = c("4/15/2013", "4/13/2013", "4/15/2013", "4/13/2013", "4/13/2013", "4/15/2013", "4/14/2013", "4/14/2013","4/14/2013" ),values = c(10, 31, 31, 17, 11, 34, 102, 47

[R] Package ‘FAdist’ - Log-Pearson Type III Distribution

2013-04-06 Thread Katherine Gobin
Dear Sir, I am referring to your package "FAdist". I wish to know how to estimate the parameters of the distribution - "Log-Pearson Type III Distribution"? Will it be possible for you to guide me or inform the package in R, I can use to estimate the parameters. Regards Katherine [[al

[R] lmomco - Three-Parameter Pearson 5 Distribution

2013-04-06 Thread Katherine Gobin
Dear R forum, I am bit confused and please guide me - (1) Is "Pearson Type III Distribution" as given in lmomco package same as Three Parameter Pearson 5 Distribution? If not, how do I estimate the parameters of Three Parameter Pearson 5 Distribution? (2) Is there any other R forum dealing wi

Re: [R] Better way of writing R code

2013-04-06 Thread Katherine Gobin
you for the same. Thanks once again and sorry for the inconvenience caused by me. Regards Katherine --- On Fri, 5/4/13, Adams, Jean wrote: From: Adams, Jean Subject: Re: [R] Better way of writing R code To: "Katherine Gobin" Cc: "R help" Date: Friday, 5 April, 2013, 2:

Re: [R] Better way of writing R code

2013-04-04 Thread Katherine Gobin
Subject: Re: [R] Better way of writing R code To: "Adams, Jean" Cc: "Katherine Gobin" , "R help" Date: Thursday, 4 April, 2013, 2:48 PM On Thu, Apr 4, 2013 at 9:32 AM, Adams, Jean wrote: > Katherine, > > You should cc the R-help on all correspondence. &

[R] Better way of writing R code

2013-04-03 Thread Katherine Gobin
Dear R forum, (Pl note this is not a finance problem) I have two data.frames as currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013", "14/6/2

Re: [R] How to delete Identical columns

2013-03-28 Thread Katherine Gobin
ichner wrote: From: Gerrit Eichner Subject: Re: [R] How to delete Identical columns To: "Katherine Gobin" Cc: r-help@r-project.org Date: Thursday, 28 March, 2013, 8:58 AM Hi, Katherine, IF the naming scheme of the columns of your data frame is consistently and if duplicated column

[R] How to delete Identical columns

2013-03-28 Thread Katherine Gobin
Dear R forum Suppose I have a data.frame df = data.frame(id = c(1:6), x = c(15, 21, 14, 21, 14, 38), y = c(36, 38, 55, 11, 5, 18), x.1 = c(15, 21, 14, 21, 14, 38), z = c("D", "B", "A", "F", "H", "P")) > df   id  x  y    x.1 z 1  1 15 36  15 D 2  2 21 38  21 B 3  3 14 55  14 A 4  4 21 11  21

Re: [R] Archieve of mails from R forum

2013-03-27 Thread Katherine Gobin
Dear Sir, Thanks a lot for the input. I am sure it will go a long way for me to understand R. Thanks again. Regards Katherine --- On Wed, 27/3/13, Mason wrote: From: Mason Subject: Re: [R] Archieve of mails from R forum To: "Marc Schwartz" Cc: "Katherine Gobin" , &

[R] Archieve of mails from R forum

2013-03-27 Thread Katherine Gobin
Dear R helpers, Everyday I do receive many many mails from R forum and after some period of times, INBOX is filled with numerous mails. At times if for some period of time, I haven't accessed mails, it becomes difficult to keep track of mails and many times simply due to the volume (and owing t

Re: [R] Counting various elemnts in a vactor

2013-03-26 Thread Katherine Gobin
Dear Sir, Thanks a lot for your great help. I couldn't have figured it out. Thanks again. Regards Katherine --- On Tue, 26/3/13, D. Rizopoulos wrote: From: D. Rizopoulos Subject: Re: [R] Counting various elemnts in a vactor To: "Katherine Gobin" Cc: "r-help@r-project

[R] Counting various elemnts in a vactor

2013-03-26 Thread Katherine Gobin
Dear R forum I have a vector say as given below df = c("F", "C", "F", "B", "D", "A", "D", "D", "A", "F", "D", "F", "B",    "C") I need to find (1) how many times each element occurs? e.g. in above vector F occurs 4 times, C occurs 2 times etc. (2) Depending on the number of occurrences, I ne

[R] How to extract values of results in gamlss.tr

2013-01-23 Thread Katherine Gobin
extract these values of Mu Coefficients and Sigma Coefficients, if I want to use these values for further analyses? Kindly guide Katherine Gobin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] lmomco package - Random number generation using Wakeby distribution

2013-01-21 Thread Katherine Gobin
From: David Winsemius Subject: Re: [R] lmomco package - Random number generation using Wakeby distribution To: "Katherine Gobin" Cc: r-help@r-project.org Date: Monday, 21 January, 2013, 7:46 PM On Jan 21, 2013, at 10:30 AM, Katherine Gobin wrote: > Dear R forum > >> From the

[R] lmomco package - Random number generation using Wakeby distribution

2013-01-21 Thread Katherine Gobin
Dear R forum >From the given data, I have estimated the parameters of Wakeby distribution >using lmomco package as library(lmomco) (amounts <- read.csv("input_S.csv")$amount) # ___ # Wakeby distribution - Parameter estimation N 

Re: [R] Can data.frame be saved as image?

2012-12-21 Thread Katherine Gobin
d mails etc, but I was bit desperate to know the solution and somehow I felt it's a stupid thing to do so. I will remember it next time. Regards Katherine --- On Fri, 21/12/12, jim holtman wrote: From: jim holtman Subject: Re: [R] Can data.frame be saved as image? To: "Katherine

[R] Can data.frame be saved as image?

2012-12-21 Thread Katherine Gobin
Dear R forum I have one stupid question, but I have no other solution to it in sight? Suppose some R process creates graphs etc alongwith main output as data.frame e.g output1 = data.frame(bands = c("A", "B", "C"), results = c(74, 108,  65)) I normally save this output as some csv file. But

[R] How to count the nos. in a range?

2012-12-20 Thread Katherine Gobin
Dear R forum I have a following vector of random no.s x = runif(100, 0.01, 0.99)  [1] 0.47212037 0.77867992 0.33947474 0.93369035   [5] 0.03720073 0.79307831 0.81801835 0.92710688 . I need to count the random no. falling in the range (0 - 0.10)

[R] Display of data points in the Scatterplot

2012-12-19 Thread Katherine Gobin
Respected R forum I am learning R and relatively quite new to R. I am generating a scatter-plot as given below. (My actual table is much larger). # Sample data frame y = c(20, 23, 17, 31, 68) x = c(200, 300, 400, 500, 600) plot(x, y, type = 'l') If I plot this scatter-plot in excel, the da