Displaying 6 results from an estimated 6 matches for "predr".
Did you mean:
preds
2013 Apr 18
1
parSapply can't find function
...cores in the cpu.
library('modeest')
library('snow')
cl = makeCluster(rep('localhost', 8), 'SOCK')
x = vector(length=50)
x = sapply(x, function(i) i=sample(c(1,0), 1))
pastK = function(n, x, k) {
if (n>k) { return(x[(n-k):(n-1)]) }
else {return(NA)}
}
predR = function(x, k) {
pastList = lapply(1:length(x), function(n) pastK(n, x, k))
pred = sapply(pastList, function(v) mfv(v)[1])
ratio = sum(pred==x, na.rm=T)/(length(pred) - sum(is.na(pred)))
}
testK = function() {
k = seq(3, 25, 2)
r = parSapply(cl, k, function(i) predR(x, i))
#...
2008 May 09
1
Using lme() inside a function
...n.)
Since I have many groups, and I wish to do the same thing for each
group, I have constructed a function which takes the dataset as input
variable and gives a prediction result (here mean absolute error) as
output.
This is an example using the Orthodont dataset:
library(MASS)
library(nlme)
PredRes<-function(D1)
{
lmemod=lme(distance~age*Sex, random=~1|Subject,
data=subset(D1,age!=14),method="ML")
themod=stepAIC(lmemod,dir="both")
prs=predict(themod,newdata=subset(D1,age==14))
obs<-subset(D1,age==14)$distance
print(mean(obs-prs))
}
Using this function with...
2008 May 07
3
function in nls argument
Greetings R users, maybe there is someone who can help
me with this problem:
I define a function "optim.fun" and want as output the
sum of squared errors between predicted and measured
values, as follows:
optim.fun <- function (ST04, SM08b, ch2no, a, b, d, E)
{
predR <-
(a*SM08b^I(2)+b*SM08b+d)*exp(E*((1/(283.15-227.13))-(1/(ST04+273.15-227.13))))
abserr <- abs(ch2no-predR)
qnum <- quantile(abserr, probs=0.95, na.rm=T)
is.na(abserr) <- (abserr > qnum)
errsq <- sum(abserr^2, na.rm=T)
errsq...
2008 May 09
2
How can one make stepAIC and lme
...tion.)
Since I have many groups, and I wish to do the same thing for each group, I have constructed a function which takes the dataset as input variable and gives a prediction result (here mean absolute error) as output.
This is an example using the Orthodont dataset:
library(MASS)
library(nlme)
PredRes<-function(D1)
{
lmemod=lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14),method="ML")
themod=stepAIC(lmemod,dir="both")
prs=predict(themod,newdata=subset(D1,age==14))
obs<-subset(D1,age==14)$distance
print(mean(obs-prs))
}
Using this function with D1=Orth...
2020 Jan 23
3
How to find out the default CPU / Features String for a given triple?
...ynosm4,-falkor,+fmi,-force-32bit-jump-tables,+fp-armv8,-fp16fml,+fptoint,-fullfp16,-fuse-address,+fuse-aes,-fuse-arith-logic,-fuse-crypto-eor,-fuse-csel,-fuse-literals,+jsconv,-kryo,+lor,+lse,-lsl-fast,+mpam,-mte,+neon,-no-neg-immediates,+nv,+pa,+pan,+pan-rwv,+perfmon,-predictable-select-expensive,+predres,-rand,+ras,+rasv8_4,+rcpc,+rcpc-immo,+rdm,-reserve-x1,-reserve-x10,-reserve-x11,-reserve-x12,-reserve-x13,-reserve-x14,-reserve-x15,-reserve-x18,-reserve-x2,-reserve-x20,-reserve-x21,-reserve-x22,-reserve-x23,-reserve-x24,-reserve-x25,-reserve-x26,-reserve-x27,-reserve-x28,-reserve-x3,-reserve-x4...
2010 Sep 24
0
kernlab:ksvm:eps-svr: bug?
...2785 if(type(object) == "one-svc")
2786 {
...
2799 }
2800 else {
2801 if(type(object)=="eps-svr"||type(object)=="nu-svr"||type(object)=="eps-bsvr")
2802 {
2803 if(is(newdata,"kernelMatrix"))
2804 predres <- newdata %*% coef(object) - b(object)
2805 else
2806 predres <- kernelMult(kernelf(object),newdata,xmatrix(object),coef(object)) - b(object)
2807 }
2808 else {
...
2829 }
2830 }
2831
2832 if (!is.null(scaling(object)$y.scale) & !is(n...