[R] Time Series

2009-10-02 Thread Kon Knafelman
Hi, Im trying to perform a time series analysis on financial data. Im going on the assumption that it follows the random walk, and therefore am fitting an ARIMA process via the following code fit-arima(exchange,order=c(0,1,0)), and then analysing the tsdiag. Is there a more efficient way of

[R] matrix exponential

2009-09-30 Thread Kon Knafelman
Hi Guys, Im trying to find the exponential of a matrix. Can someone please help me do this? Thanks a lot _ View photos of singles in your area Click Here

[R] time series and ACF

2009-09-29 Thread Kon Knafelman
Hey guys, im sort of a beginner with R, but here's what i need to do. i need to perform a time series analysis on a set of financial data that i've been given. im trying to look at the ACF and PACF and fit it to a particular model (i think its the ARIMA model because i've read that financial

[R] FW: time series and ACF

2009-09-29 Thread Kon Knafelman
Hey guys, im sort of a beginner with R, but here's what i need to do. i need to perform a time series analysis on a set of financial data that i've been given. im trying to look at the ACF and PACF and fit it to a particular model (i think its the ARIMA model because i've read that

[R] Inverse

2009-05-21 Thread Kon Knafelman
Hi Guys, i think this is a relatively simple question. I have coded the following polynomial function y= function(x) x^3-2*x^2+1 I need to find the inverse of this, but the code i am using now isnt returning what i want it to. What is the general code for finding an inverse function?

[R] evaluate polynomial

2009-05-20 Thread Kon Knafelman
Hey guys, sorry im drawing a mental blank. i have coded the function: y - function(x) 6*x^4-(1*x^2)^3 How do i evaluate this function for a given x? i know this is a ridiculous question, but thanks anyway _ [[elided

Re: [R] Simulation

2009-05-18 Thread Kon Knafelman
Hi peter, Quite an insight you have there hehe. i am continuing on from the orignal problem of creating a simulation. Im now trying to find (n−1)S2/σ2, and fit it to a chi squared dist with 5 degrees of freedom. im having trouble with the coding for this. i think for the second part of

[R] sample variance from simulation

2009-05-18 Thread Kon Knafelman
Hi, g=list() for(i in 1:1000){z[[i]]=rnorm(15,0,1)} I've attempted a similar problem based on the above method. Now, if i want to find the sample variance, do i go about it like this? for (i in 1:1000)vars[[i]] = sum(z[[i]]) vars[[i]] the overall sigma squared will just be 1, because

[R] fitting distribution

2009-05-18 Thread Kon Knafelman
Hey Guys, i have the sample variances for 1000 samples, and i want to fit it to a chi-squared distribution. after making a loop for the simulation initially, i have the following code to compute the variances samples = replicate(n, rnorm(m, 0, 1), simplify=FALSE) variances = sapply(samples,

[R] Simulation Help

2009-05-17 Thread Kon Knafelman
Hey Guys, i need 1000 samples of size 15, for distributions of Exp(1) and Norm(0,1). here is what i have done so far.For the exponential z-list() for(i in 1:1000){z[[i]]=rexp(15,1)} For the Normal y-list() for(i in 1:1000){y[[i]]=rnorm(15,0,1)} Is this correct? after this i need to

[R] Gamma

2009-05-16 Thread Kon Knafelman
Hey, I am having trouble graphing the following function √2Γ(n/2)/[√n − 1Γ((n − 1)/2 for the values of n between 2 and 50. i know that Γ(n) = (n-1)!, which in R is factorial(n-1) When i type that into R, using y - function(n). and then plot(y,2,50), it doesnt give me anything

[R] Gamma function

2009-05-16 Thread Kon Knafelman
Hi Guy, I am having trouble graphing the following function √2Γ(n/2)/[√n − 1Γ((n − 1)/2 for the values of n between 2 and 50. i know that Γ(n) = (n-1)!, which in R is factorial(n-1) When i type that into R, using y - function(n). and then plot(y,2,50), it doesnt give me

[R] Newton's method for finding roots

2009-05-16 Thread Kon Knafelman
Hey guys, i have a relatively simple problem. I need to use netwon's method to find the root of a polynomial, lets say x^3-2x-1 i start off with p - function(x) x^3-2*x-1 My method, which im sure is very amateur, is to type another function, which is the derivative of p, and after picking

Re: [R] Simulation

2009-05-15 Thread Kon Knafelman
hey guys, i've been following this discussion about the simulation, and being a beginner myself, im really unsure of the best method. I hve the same problem as the initial one, except i need 1000 samples of size 15, and my distribution is Exp(1). I've adjusted some of the loop formulas for

[R] Simulation

2009-05-15 Thread Kon Knafelman
hey guys, i've been following this discussion about the simulation, and being a beginner myself, im really unsure of the best method. I hve the same problem as the initial one, except i need 1000 samples of size 15, and my distribution is Exp(1). I've adjusted some of the loop formulas

[R] (no subject)

2009-05-12 Thread Kon Knafelman
a root for this. Please help. Regards, Kon Knafelman _ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] newtons method

2009-05-12 Thread Kon Knafelman
Hi, Does anyone know how to code newton's method for finding the roots of polynomial functions? im not sure whether i need to do this manually, or just code something with a loop to stop when it gets to the desired result thanks guys!