[R] Question about copula-GARCH model

2008-06-20 Thread Jonas Malmros
obvious thing, but I just do not get it. :-( Could you please help me understand? How do I do it in MATLAB or R? THanks in advance! -- Jonas Malmros __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] How to remove double for loop?

2008-03-19 Thread Jonas Malmros
, nrow=n+1, ncol=n+1) for( i in 0:n){ for(j in 0:i){ Val[j+1, i+1] - u^j*d^(i-j) } } Thank you in advance! -- Jonas Malmros __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] How to remove double loop?

2008-03-19 Thread Jonas Malmros
the double loop part now that OVal is used within the function itself? It is pretty easy to write for loops, but it is very hard to write computationally optimal code. :-( Could you please help me with the above one, if possible? -- Jonas Malmros Stockholm University Stockholm, Sweden

Re: [R] Polynomial fitting

2008-01-09 Thread Jonas Malmros
-91.633939 poly(x, 3, raw = TRUE)3 5.800653 And there's your coefficients. See help(poly) for more. Barry -- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org mailing list https

[R] Polynomial fitting

2008-01-07 Thread Jonas Malmros
I wonder how one in R can fit a 3rd degree polynomial to some data? Say the data is: y - c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x - seq(3.75, 6, 0.25) And resulting degrees of polynomial are: 5.8007 -91.6339 472.1726 -774.2584 THanks in advance! -- Jonas

[R] Diagonal matrix with off diagonal elements

2007-12-21 Thread Jonas Malmros
Hi, everyone I wonder if there is a function in R with which I can create a square matrix with elements off main diagonal (for example one diagonal below the main diagonal). Thanks in advance! -- Jonas Malmros Stockholm University Stockholm, Sweden

[R] How to create a mixed col.names?

2007-12-17 Thread Jonas Malmros
with rep but did not succeed. Could someone please suggest a solution to this problem? Thanks in advance! Regards, JM -- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Cannot grasp how to apply by here...

2007-12-17 Thread Jonas Malmros
. What am I doing wrong? Do not understand. :-( Thank you in advance for your help. Regards, JM -- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Cannot grasp how to apply by here...

2007-12-17 Thread Jonas Malmros
Obviously, A cannot assign a row name because the dimensions do not agree. I can use rownames(vector) - x$Name[1] though. then things get calculated (I saw it with browser()) but rbind does not do what I want it to do, results remains numeric(). why? -- Jonas Malmros Stockholm University

Re: [R] Cannot grasp how to apply by here...

2007-12-17 Thread Jonas Malmros
Dear Charilaos, Thanks, I see what you mean, but I just simplified the real code here and I made a mistake by putting +2, it is +1. :-) JM On Dec 17, 2007 8:02 PM, Charilaos Skiadas [EMAIL PROTECTED] wrote: On Dec 17, 2007, at 1:47 PM, Jonas Malmros wrote: factor.names - c(Factor1

[R] Why is conversion not working?

2007-12-17 Thread Jonas Malmros
$Year[i] - as.numeric(database$year[i])+1900 } else { database$Year[i] - as.numeric(database$year[i])+2000 } } Thanks in advance for explanations. Regards, JM -- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org

[R] Cleaning database: grep()? apply()?

2007-11-13 Thread Jonas Malmros
this adjustments. I am new to R, I do write code but usually it consists of for-functions and plotting. I would much appreciate your help. Thank you in advance! -- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org mailing list https

Re: [R] textplot() in gplots causes problems (0x9)

2007-11-01 Thread Jonas Malmros
() doesn't attempt to optimize it. I personally choose the former, avoid tab characters, since the appropriate font size varies greatly by device. -Greg On Oct 31, 2007, at 3:22PM , Jonas Malmros wrote: Hello, I am using textplot function in gplots package to put some model output inside

Re: [R] textplot() in gplots causes problems (0x9)

2007-11-01 Thread Jonas Malmros
, : font width unknown for character 0x9 5: In text.default(x = xpos, y = ypos, labels = object, adj = c(0, : font width unknown for character 0x9 in PDF everything looks fine! Thank you for your time! Jonas. On 11/1/07, Jonas Malmros [EMAIL PROTECTED] wrote: Dear Gregory, How can I avoid

[R] textplot() in gplots causes problems (0x9)

2007-10-31 Thread Jonas Malmros
-- Jonas Malmros Stockholm University Stockholm, Sweden __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] Attaching interactive plot to existing PDF file

2007-10-28 Thread Jonas Malmros
(), which = dev.prev()) : cannot supply 'which' and 'device' at the same time and when I close off the devices, my PDF file contains only barplots and histograms. Could someone please instruct me? Thank you in advance for your time and help. -- Jonas Malmros Stockholm University Stockholm

[R] glm with Student t for error distribution

2007-10-26 Thread Jonas Malmros
proceed to fit glm with Student t? I know that Student t is the Inverse Gamma with shape parameter equal to degrees of freedom (=4). Would it be correct then to specify Gamma family and inverse link in the glm function? Thank you for your help. Jonas M. University of Stockholm -- Jonas Malmros