# NOT RUN {
## Genarating item and ability parameters (1000 participants, 100 items)
a <- rlnorm(100,0,0.3)
b <- rnorm(100,0,1)
responses <- matrix(NA, nrow=1000, ncol=100)
theta <- rnorm(1000, 0,1)
### Defining Response Function (2 PL)
pij <- function(a,b,theta) {
1/(1+exp(-1*a*(theta-b)))
}
### Creating Response Matrix and column names.
for( i in 1:1000 ) {
for( j in 1:100 ) {
responses[i,j]<-ifelse(pij(a=a[j], b=b[j], theta[i]) < runif(1) , 0 ,1)
}
}
names<-paste("i",1:ncol(responses),sep = "_")
colnames(responses)<-names
train<-as.data.frame(responses)
small.index<-sample(1:nrow(train),100,replace=FALSE)
small<-train[small.index,]
### Conducting Function
conv.ann(small.data=small, train.data=train, model="2PL",layers=c(2,2),
learningrate=NULL,treshold=0.01)
# }
Run the code above in your browser using DataLab