Displaying 1 result from an estimated 1 matches for "signalest".
Did you mean:
signaltest
2007 Jul 17
1
fit a nonlinear model using nlm()
...lt;-.5
noisesd<-.1
# each row is a new stim (trial). 500 trials
resp<-array(dim=500)
stim<-matrix(nrow=500,ncol=100)
for (i in 1:500)
{
stim[i,]<-signal+rnorm(n=length(signal), mean=0, sd=noisesd)
if (sum(stim[i,]*signal)>crit) (resp[i]<-1) else (resp[i]<-0)
}
f<-function(signalest)
{
r<-array(dim=500)
for (i in 1:500)
{
r[i]<-sum(stim[i,]*signalest)>critest
}
sum((r-resp)^2)
}
fit<-nlm(f, stim[1,])