[R] R Help

2012-03-31 Thread Jaymin Shah
Hi, I have a polynomial of 2n^2-5n+3 and I have my n values going up in powers of 2 i.e. n=2,4,8,16….. I wanted to fit this curve to the function A*n*log2(n) +B*n where A and B are to be found. How would i do this? Thank you Jaymin __

Re: [R] Help needed please

2012-02-25 Thread Jaymin Shah
I was wondering how to make a function which minimises a vector (a,b,c,d). I have an equation ( for simplicity) say its 5 -(3a+4b+6c+8d) and i want to make this equation as small as possible. Thus need to find the values for a b c and d for which this happens. I know there is a function in

[R] Help needed please

2012-02-10 Thread Jaymin Shah
I have coded a time series from simulated data: simtimeseries - arima.sim(n=1024,list(order=c(4,0,0),ar=c(2.7607, -3.8106, 2.6535, -0.9258),sd=sqrt(1))) #show roots are outside unit circle plot.ts(simtimeseries, xlab=, ylab=, main=Time Series of Simulated Data) # Yule

[R] Help need

2012-02-07 Thread Jaymin Shah
I have mad a for loop to try and output values which i have named spectrum. However, I cannot seem to get the answers to come out as a vector which is what i need. They come out as separate values which I am then unable to join together. Thank you for(f in seq(0,0.5,0.1)) {