
Boa tarde pessoal, Estou tentando utilizar C e R juntos, fiz 3 funções em C e chamo elas do R. Mas estive testando e testando e deu este erro. Na verdade as vezes da este erro e as vezes trava de vez. Não sei se é pela forma em que estou programando em C (na verdade estou bem enferrujado e estou utilizando ponteiros) deixo aqui o código quem puder de uma olhadinha. [image: Imagem inline 2] Na verdade é um mesmo código que faço três vezes (assim que descobri o erro). O problema aparece quando rodo mais de dois vezes (por isso que aqui copiei o codigo 3 vezes) source("volatnGarch.r") source("sbootGarch.r") source("forebootGarch.r") yb = rnorm(10000) d = 1 p=1 q=1 garchOrder = c(p,q) Coeff_b = c(0.01,0.1,0.85) aux1 = Coeff_b[1]/(1-Coeff_b[2]-Coeff_b[3]) aux3 = cumsum(c(1,1)) C = sbootGarch(aux1,yb,Coeff_b,garchOrder) A = volatnGarch(yb,Coeff_b,garchOrder) e_b = rnorm(5) n.ahead = length(e_b) B = forebootGarch(yb,e_b,A[[1]],Coeff_b,garchOrder) rm(list=ls(all=TRUE)) source("volatnGarch.r") source("sbootGarch.r") source("forebootGarch.r") yb = rnorm(10000) d = 1 p=1 q=1 garchOrder = c(p,q) Coeff_b = c(0.01,0.1,0.85) aux1 = Coeff_b[1]/(1-Coeff_b[2]-Coeff_b[3]) aux3 = cumsum(c(1,1)) C = sbootGarch(aux1,yb,Coeff_b,garchOrder) A = volatnGarch(yb,Coeff_b,garchOrder) e_b = rnorm(5) n.ahead = length(e_b) B = forebootGarch(yb,e_b,A[[1]],Coeff_b,garchOrder) rm(list=ls(all=TRUE)) source("volatnGarch.r") source("sbootGarch.r") source("forebootGarch.r") yb = rnorm(10000) d = 1 p=1 q=1 garchOrder = c(p,q) Coeff_b = c(0.01,0.1,0.85) aux1 = Coeff_b[1]/(1-Coeff_b[2]-Coeff_b[3]) aux3 = cumsum(c(1,1)) C = sbootGarch(aux1,yb,Coeff_b,garchOrder) A = volatnGarch(yb,Coeff_b,garchOrder) e_b = rnorm(5) n.ahead = length(e_b) B = forebootGarch(yb,e_b,A[[1]],Coeff_b,garchOrder) rm(list=ls(all=TRUE)) as funções em C seguem no seguinte link. https://www.dropbox.com/sh/5f8bpx6pt2cgam6/fcuvUtFili/Codigos *Carlos Trucíos Maza ** : ctrucios@gmail.com