Ambos lados da revisão anteriorRevisão anteriorPróxima revisão | Revisão anterior |
pessoais:eder [2011/06/06 20:50] – [section 5] eder | pessoais:eder [2018/07/04 19:10] (atual) – [section 5] eder |
---|
* Estatística Espacial | * Estatística Espacial |
* [[http://www.leg.ufpr.br/doku.php/projetos:gem2|GEM²]] Grupo de estudos em modelos mistos | * [[http://www.leg.ufpr.br/doku.php/projetos:gem2|GEM²]] Grupo de estudos em modelos mistos |
| * {{:pessoais:inlarrblup.r|GWS}} Seleção Genômica Ampla Via ML REML INLA |
| * {{:pessoais:reml_inla.r|Script}} Modelo seleção Genótipo ambiente via REML ML INLA |
| * {{:pessoais:linearregression.rnw|Script}} Regressão Linear - inferência via Mínimos quadrados, ML, REML, Gibbs, Metropolis, INLA, dclone ... (Em construção) |
| * {{:pessoais:rjmcmc.r|RJMCMC}} Reversible Jump MCMC Regressão Linear |
| ===== Artigos de Interesse ===== |
| * {{http://www.sciencedirect.com/science/article/pii/S0022030278835905|Simulation of Examine Distributions of Estimators of Variances and Ratios of Variances}} |
| * {{http://www.jstor.org/stable/3001853|Estimation of Variance and Covariance Components}} |
| * {{http://www.sciencedirect.com/science/article/pii/S0022030291786013|C. R. Henderson: Contributions to Predicting Genetic Merit}} |
| * {{http://www.sciencedirect.com/science/article/pii/S002203027584776X|Rapid Method for Computing the Inverse of a Relationship Matrix}} |
| * {{http://www.jstor.org/stable/2527669?seq=18|The Estimation of Environmental and Genetic Trends from Records Subject to Culling}} |
| * {{http://download.journals.elsevierhealth.com/pdfs/journals/0022-0302/PIIS002203027584776X.pdf|Rapid Method for Computing the Inverse of a Relationship Matrix}} |
| * {{http://www.jstor.org/pss/2529339|A simple method for computing the inverse of a numerator relationship matrix used in prediction of breeding values}} |
| * {{http://www.jstor.org/stable/2529430?&Search=yes&searchText=%22C.+R.+Henderson%22&list=hide&searchUri=%2Faction%2FdoBasicSearch%3FQuery%3Dau%253A%2522C.%2BR.%2BHenderson%2522%26wc%3Don&prevSearch=&item=3&ttl=373&returnArticleService=showFullText|Best Linear Unbiased Estimation and Prediction under a Selection Model}} |
| * {{http://www.jstor.org/stable/2530609?&Search=yes&searchText=%22C.+R.+Henderson%22&list=hide&searchUri=%2Faction%2FdoBasicSearch%3FQuery%3Dau%253A%2522C.%2BR.%2BHenderson%2522%26wc%3Don&prevSearch=&item=5&ttl=373&returnArticleService=showFullText|Variance-Covariance Matrix of Estimators of Variances in Unweighted Means ANOVA}} |
| * {{http://www.jstor.org/stable/3001853?&Search=yes&searchText=%22C.+R.+Henderson%22&list=hide&searchUri=%2Faction%2FdoBasicSearch%3FQuery%3Dau%253A%2522C.%2BR.%2BHenderson%2522%26wc%3Don&prevSearch=&item=2&ttl=373&returnArticleService=showFullText| Estimation of Variance and Covariance Components}} |
| |
| |
===== Disciplinas 2011/1 ===== | ===== Disciplinas 2011/1 ===== |
* [[http://www.leg.ufpr.br/doku.php/disciplinas:ce210-2010-02|CE-210: Inferência estatística II]] | * [[http://www.leg.ufpr.br/doku.php/disciplinas:ce210-2010-02|CE-210: Inferência estatística II]] |
* [[http://www.leg.ufpr.br/doku.php/pessoais:eder:planejamentofito|Planejamento de experimento PG Produção Vegetal UFPR]] | * [[http://www.leg.ufpr.br/doku.php/pessoais:eder:planejamentofito|Planejamento de experimento PG Produção Vegetal UFPR]] |
* [[http://www.leg.ufpr.br/doku.php/pessoais:eder:exptempo| Análise de Experimentos de longa duração]] II Reunião Paranaense Ciência do Solo | * [[http://www.leg.ufpr.br/doku.php/pessoais:eder:exptempo| Análise de Experimentos de longa duração]] II Reunião Paranaense Ciência do Solo |
===== Códigos ===== | * [[http://www.leg.ufpr.br/doku.php/pessoais:eder:runicentro| Curso de Sofware R Analise Experimentos - UNICENTRO]] |
| ===== Códigos (Em construção) ===== |
<code R> | <code R> |
###-----------------------------------------------------------------### | ##------------------------------------------------------------------### |
### Agulha de buffon | |
buffon <- function(n,l=1,a=1){ | |
if(a<l){cat('Erro: a < l, deve ser a > l\n')} | |
if(a>=l){ | |
theta <- runif(n,0,pi) | |
dist <- runif(n,0,a/2) | |
inter <- sum(dist <= l/2*sin(theta)) | |
phi_est <- round((n/inter)*(2*l/a),12) | |
cat('Número Simulação',n,'phi_estimado',phi_est,'Erro',round(pi-phi_est,12),'\n') | |
return(c(n,phi_est)) | |
}} | |
| |
n <- seq(10000,1000000,by=20000) | |
res <- matrix(NA,ncol=2,nrow=length(n)) | |
con <- 1 | |
for (i in n){ | |
res[con,] <- buffon(i) | |
con <- con+1 | |
} | |
| |
plot(res,type='l',ylab=expression(pi),xlab='Simulações') | |
abline(h=pi,col='red') | |
###-----------------------------------------------------------------### | |
### MOnte carlo | |
## Calcula a área via simulação de monte carlo | |
## args: r= raio, s vetor com numero de simulação, plotS plotar a simulação | |
MCcirculo<-function(r,s,plotS=TRUE){ | |
ns<-area<-s | |
r<-r | |
con <- 1 | |
for (j in ns) { | |
#pontos aleatorios | |
x<-runif(j, min=-r, max=r) | |
y<-runif(j, min=-r, max=r) | |
ponto<-cbind(x,y) | |
cont <- sum(apply(ponto,1,function(x){sqrt(sum(x^2))})<r) | |
#plotando Simulação | |
if(plotS==TRUE){ | |
plot(x,y,col="red",type="p",asp=1,lwd=1,xlim=c(-r,r),ylim=c(-r,r), main="Simulação Monte Carlo",sub=j) | |
ang <- seq(0, 2*pi, length = 100) | |
xx <- r * cos(ang);yy <- r * sin(ang) | |
polygon(xx, yy,border = "dark blue",lwd=2) | |
} | |
#Calculo de Area | |
area[con]<-(cont/j)*(r^2)*4 | |
cat(paste(round(area[con],6),j,'\n')) | |
con <- con+1 | |
} | |
plot(ns,area,main="Simulação Monte Carlo",xlab='Número da amostra',ylab='Area') | |
abline(h=pi*r^2,col='red',lwd=2) | |
| |
} | |
MCcirculo(1,seq(5,5000,by=1000),plotS=FALSE) | |
###-----------------------------------------------------------------### | |
### Inversão de Probabilidade | |
### OBJ: gerar x~exp transformando de uma uniforme | |
NS <- 10000 | |
lam <- 0.5 | |
#f(x)=exp(lam) F(x)=1-exp(-lam*x), logo: F^-1(x)= -lam^-1*log(1-x) | |
Gexp <- function(x,lam){-(log(1-U))/lam} | |
| |
U <- runif(NS) | |
X <- Gexp(U,lam) | |
Y <- rexp(NS,lam) | |
| |
par(mfrow=c(1,3)) | |
hist(U,freq=FALSE,main='Uniforme',col='lightblue') | |
lines(density(U),col='red',lwd=2) | |
| |
hist(X,freq=FALSE,main='Expoencial via uniforme',col='lightblue') | |
lines(density(X),col='red',lwd=2) | |
lines(curve(dexp(x,lam),min(X),max(X),add=TRUE),col='blue',lwd=2) | |
| |
hist(Y,freq=FALSE,main='Expoencial do R',col='lightblue') | |
lines(density(Y),col='red',lwd=2) | |
lines(curve(dexp(x,lam),min(Y),max(Y),add=TRUE),col='blue',lwd=2) | |
###-----------------------------------------------------------------### | ###-----------------------------------------------------------------### |
### Regressão Beta | ### Regressão Beta |
return(ll) | return(ll) |
} | } |
| |
###-----------------------------------------------------------------### | ###-----------------------------------------------------------------### |
opt <- optim(c(B0=-0.5,B1=-0.51,B2=0.11,phi=35),log.vero,y=FoodExpenditure$food/FoodExpenditure$income, | opt <- optim(c(B0=-0.5,B1=-0.51,B2=0.11,phi=35),log.vero,y=FoodExpenditure$food/FoodExpenditure$income, |
summary(fe_beta) | summary(fe_beta) |
###-----------------------------------------------------------------### | ###-----------------------------------------------------------------### |
| log.veroP <- function(par,phi,y,x1,x2){ |
| mu <- exp((par[1] + par[2] * x1 + par[3] * x2))/(1+exp((par[1] + par[2] * x1 + par[3] * x2)))##logit^-1 |
| ll <- sum(dbeta(y, mu* phi, (1-mu)*phi,log = TRUE)) |
| return(ll) |
| } |
| |
| opt <- grid.phi <- seq(20,60,l=150) |
| con <- 1 |
| for (i in grid.phi){ |
| opt[con] <- optim(c(B0=-0.5,B1=-0.51,B2=0.11),log.veroP,phi=i,y=FoodExpenditure$food/FoodExpenditure$income, |
| x1=FoodExpenditure$income, |
| x2=FoodExpenditure$persons, |
| hessian = TRUE, control=(list(fnscale=-1)))$value |
| con <- con+1 |
| } |
| |
| plot(grid.phi,2*(max(opt)-opt),type='l') |
| abline(h=3.84) |
| |
</code> | </code> |
| |