HI
I got a problem in the predict function of the kernlab.
I want to use ksvm and predict with kernelmatrix (S4 method for signature
'kernelMatrix')
#executing the following sentences
library(kernlab)
# identity kernel
k - function(x,y) {
n-length(x)
cont-0
for(i in 1:n){
Hi,
I am trying out the SparseM package and had the a
question. The following piece of code works fine:
...
fit = slm(model, data = trainData, weights = weight)
...
But how do I use the fit object to predict the values
on say a reserved testDataSet? In the regular lm
function I would do
If you are feeling altruistic you could write a predict method for
slm objects, it wouldn't be much work to adapt what is already
available and follow the predict.lm prototype. On the other
hand if you are looking for something quick and dirty you can
always resort to
newX %*%
I am trying to use lm() for resression followed by
stepAIC function. Now when i try to use to predict for
some input, predict() gives a warning : prediction
from a Rank deficient matrix may be misleading.
As I am new to R (or to statistics) How alarming this
warning may be?
Regards,
Hi Everyone,
I often use the 'safe prediction' feature available through glm().
Now, I'm at a situation where I must use biglm:::bigglm.
## begin example
library(splines)
library(biglm)
ff - log(Volume)~ns(log(Girth), df=5)
fit.glm - glm(ff, data=trees)
fit.biglm - bigglm(ff, data=trees)
Part of the fit is the Kalman filter state after running the model
forwards. Try reversing your series, fitting and then forecasting.
You might have more success in understanding arima0.
On Sat, 25 Nov 2006, Franck Arnaud wrote:
Hi all,
Forecasting from an arima model is easy with predict.
Hi all,
Forecasting from an arima model is easy with predict.
But I can't manage to backcast : invent data from the model before the
begining of the sample.
The theory is easy : take your parameters, reverse your data, forecast, and
then reverse the forecast
I've tried to adapt the predict
Jan Sabee jan.sabee at gmail.com writes:
I know that is probability of predict for new dataset.
My question is how can I know each probability according to class (sore).
I mean that I need the result of predit something like (M=1, F=0):
1 2 3 4 5 6 7 8 9 10
1 0 0 0 1 0 1 1
I am learning about using logistic regression with glm.
Suppose I have dataset:
duration -
c(45,15,40,83,90,25,35,65,95,35,75,45,50,75,30,25,20,60,70,30,60,61,65,15,20,45,15,25,15,30,40,15,135,20,40)
type -
c(0,0,0,1,1,1,rep(0,5),1,1,1,0,0,1,1,1,rep(0,4),1,1,0,1,0,1,0,0,rep(1,4))
sore -
I want to do a nonparametric regression. Im using the function loess.
The variable are the year from 1968 to 1977 and the dependant variable
is a proportion P. The dependant variable have missing value (NA).
The script is :
year - 1969:2002
length(year)
On Tue, 13 Jun 2006, Jouanin Celine wrote:
I want to do a nonparametric regression. Im using the function loess.
The variable are the year from 1968 to 1977 and the dependant variable is
a proportion P. The dependant variable have missing value (NA).
The script is :
The dse2 package contains functions forecast and forecastCov.
Have you tried them?
There may be functions to estimate vector autoregressive models in
more than one package in R. If you'd like more help from this
listserve, I would encourage you to submit another post after
What can I do?
Thanks a lot!
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Michael == Michael [EMAIL PROTECTED] writes:
Michael What can I do?
Implement this feature and send it to the person responsible for the
code for inclusion?
Michael Thanks a lot!
Indeed, you contribution would be very much appreciated.
Cheers,
Berwin
Using R to predict.nls() using new data, `se.fit' and `interval' are
ignored. . Is there any update for this? Anybody has those routine or may
advise me how to do that? Thanks
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch
Sandra,
hard to tell where the error message originates from without having the data
at hand (perhaps you could provide that to me off-list?), but I am almost
sure things will work when you train the model the standard way:
cd1.svm-svm(Acode~EXT+TOF, data = boot.dist.dat, cost=100, gamma=20)
I am using the predict function on a support vector machine (svm)
object, and I don't understand why I can't predict on a dataset with more
observations than the training dataset.
I think this problem is a generic predict problem, but I'm not sure.
The original svm was fit on 50 observations.
Dear R-helpers,
let us assume, that I have the following dataset:
a - rnbinom(200, 1, 0.5)
b - (1:200)
c - (30:229)
d - rep(c(q, r, s, t), rep(50,4))
data_frame - data.frame(a,b,c,d)
In a first step I run a glm.nb (full code is given at the end of this mail) and
want to predict my response
This is seems to be an unstated repeat of much of an earlier and
unanswered post
https://stat.ethz.ch/pipermail/r-help/2005-August/075914.html
entitled
[R] error in predict glm (new levels cause problems)
It is nothing to do with `nbinomial glm' (sic): all model fitting
Katharina,
I agree with Prof. Ripley's assessment. But, perhaps one thing you may
have overlooked is that subset.data.frame does not remove unused levels. So,
subset_of_dataframe = subset(data_frame, (b 80 c 190))
levels(subset_of_dataframe$d)
[1] q r s t
table(subset_of_dataframe$d)
When I callculate a linear model, then I can compute via confint the
confidencial intervals. the interval level can be chosen. as result, I get
the parameter of the model according to the interval level.
On the other hand, I can compute the prediction-values for my model as well
with
Dear Matthias
Can you provide an example to demonstrate what you did? Two
remarks to your email. Maybe that answers already your question.
1) Using predict() you will get the estimated value for each
observation or for new data. You can reproduce this value by
using the coefficients from
I use predict for predictions from glm. I am wondering if there is a
predict function for predictions from the results of GLMM model?
Thanks ahead!
Weihong Li
Undergraduate Student in Statistics
University of Alberta
__
R-help@stat.math.ethz.ch
Hi, there:
Following yesterday's question ( i had a new level for a categorical
variable occurred in validation dataset and predict() complains about
it: i made some python code to solve the problem), but here, I am just
curious about some details about the mechanism:
I believed rpart follows
Hi, there:
I have a question on predict() function.
I built a set of trees using rpart and when I do prediction, I got the
following error:
Error in model.frame.default(Terms, newdata, na.action = act, xlev = attr(object
, :
factor V19 has new level(s) 45
Execution halted
I think the
Dear all
Please help me with correct syntax of predict.nlme.
I would like to predict from nlme object for new data.
I used predict(fit.nlme6, data=newdata) but I have always got
fitted values, no matter how I changed newdata.
I have
summary(fit.nlme6)
Nonlinear mixed-effects model fit by
Petr Pikal wrote:
Dear all
Please help me with correct syntax of predict.nlme.
I would like to predict from nlme object for new data.
I used predict(fit.nlme6, data=newdata) but I have always got
fitted values, no matter how I changed newdata.
I have
The argument's name is newdata, not
Dear All,
R 1.9.1, Windows
When copying and pasting a few lines from the 'predict.Arima' help, I
get an error message:
data(lh)
predict(arima(lh, order = c(3,0,0)), n.ahead = 12)
Error in eval(expr, envir, enclos) : Object xreg not found
On the other hand, the following is OK:
data(lh)
Nothing is wrong with arima: those commands are part of make check, so
your copy of R has been corrupted. Search for masked functions, and try
starting R with --vanilla.
On Sun, 29 Aug 2004, Remigijus Lapinskas wrote:
Dear All,
R 1.9.1, Windows
When copying and pasting a few lines from
Hello,
After reading the help for predict.lm and predict.glm, it is not clear
to me what are the values returned by predict( ..., type=terms).
Anybody willing to enlighten me?
The example provided by Peter Dalgaard in a recent post unfortunately
was enlightening only to the point of making me
On Wed, 7 Apr 2004, Giovanni Petris wrote:
Hello,
After reading the help for predict.lm and predict.glm, it is not clear
to me what are the values returned by predict( ..., type=terms).
Anybody willing to enlighten me?
For each term in the formula, extract its coefficients and the
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Lumley
Sent: Wednesday, April 07, 2004 5:44 PM
To: Giovanni Petris
On Wed, 7 Apr 2004, Giovanni Petris wrote:
Hello,
After reading the help for predict.lm and predict.glm, it
is not
Uwe Ligges wrote:
Thomas Jagoe wrote:
I am using R to do a loess normalisation procedure.
.
.
.
However in 1.8.1 all goes well until the last step when I get an error:
Error: couldn't find function predict.loess
Can anyone help ?
Use predict() instead of
If you know what you're looking for, you can always get to non-exported
function by using :::, e.g., modreg:::predict.loess will give you the
function.
Andy
From: Rolf Turner
Uwe Ligges wrote:
Thomas Jagoe wrote:
I am using R to do a loess normalisation procedure.
.
.
Dear Roft and Andy,
At 10:41 AM 2/14/2004 -0500, Liaw, Andy wrote:
If you know what you're looking for, you can always get to non-exported
function by using :::, e.g., modreg:::predict.loess will give you the
function.
and getS3method(predict, loess) or getAnywhere(predict.loess) will
retrieve
]
Subject: Re: [R] predict function
On Sat, 14 Feb 2004 10:41:41 -0500, you wrote:
If you know what you're looking for, you can always get to non-exported
function by using :::, e.g., modreg:::predict.loess will give you the
function.
Or
getAnywhere('predict.loess')
or
getS3method
I am using R to do a loess normalisation procedure.
In 1.5.1 I used the following commands to normalise the variable logratio,
over a 2d surface (defined by coordinates x and y):
array - read.table(121203B_QCnew.txt, header=T, sep=\t)
array$logs555-log(array$s555)/log(2)
You can't use this anymore. The function predict() has a method
for loess objects, but there is no longer an available function
called predict.loess. So just replace predict.loess
with predict.
On Fri, 13 Feb 2004, Thomas Jagoe wrote:
I am using R to do a loess normalisation procedure.
In
Hello
running R 1.7.1 on Windows 2000
I have a model
notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0,
family = quasipoisson)
and summary(notmar1) gives (as it should) 433 df for the null model
but when I run
predict(notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0,
Have you tried the following:
notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0,
family = quasipoisson), data=DF)
predict(notmar1, newdata=DF[DF$marcom==0,])
I haven't tested this specific code, but I've gotten sensible
results from constructs like this in the past.
hope this
example(predict.glm)
fit - glm(SF ~ ldose, family=binomial, subset=sex==M)
predict(fit)
[1] -2.8185550 -1.5596055 -0.3006561 0.9582933 2.2172427 3.4761922
which is just the males.
So, that example works correctly, and predict.glm as called by you should
just return the fitted values, as
Hello,
I've just fitted a model with multi-responses, and I get an object of class
lm mlm.
My problem is that as soon as I invoke the predict method for a dataframe
newdata, the methods runs and give me back prediction at the fitting
points but not for newdata.
Does someone has an explanation
From: ZABALZA-MEZGHANI Isabelle
Hello,
I've just fitted a model with multi-responses, and I get an
object of class lm mlm. My problem is that as soon as I
invoke the predict method for a dataframe newdata, the
methods runs and give me back prediction at the fitting
points but not
I've got a data frame with two numeric variables, df$flow and df$flow1.
tl - lm(flow~flow1,df,na.action=na.exclude)
tlo - loess(flow~flow1,df,na.action=na.exclude)
Both loess and a simple linear model fit the data well.
summary(tl) and summary(tlo) seem reasonable. As do plots such as:
It uses the appropriate method for the generic function predict().
In your case it is predict.ar(), and you can examine it by
getS3method(predict, ar)
On Tue, 15 Jul 2003, ATHANASIA KAMARIOTIS wrote:
Can you please tell me how R computes : predict(ar.x)$pred
in :
#let x be a vector
Good afternoon,
Can you please tell me how R computes : predict(ar.x)$pred
in :
#let x be a vector
ar.x-ar(x)
predict(ar.x)$pred
Thank you
Bye
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Hello
On the subject of using predict formula with variables,
I used cbind(var1,var2,var3,var4, predict(glm.obj,type=resp)) to find
probability
of each combinations. However,I am still hesitant whether I have done
it correctly.
Is it correct ?
thanks in advance
Ahmet Temiz
Turkey
47 matches
Mail list logo