[R] Cross validation multivariate kernel regression

2019-11-18 Thread Preetam Pal
Hi, This question is general- I have a data set of n observations, consisting of a single response variable y and p regressor variables.( n ~50, p~3 or 4). I am planning to implement Nadaraya-Watson regression model, with bandwidths optimized via cross-validation. For cross-validation, I will

Re: [R] Forecasting using VECM

2017-02-19 Thread Preetam Pal
Hey Bert, The predict function in the link you mentioned does not seem to use independently generated future values of the variables cpiUSA and cpiCAN in calculating the future values of the variable of interest, i.e. dolCAN. As I mentioned in the mail, I have the future cpiUSA and cpiCAN values

[R] Forecasting using VECM

2017-02-14 Thread Preetam Pal
Hi, I have attached the historical dataset (titled data) containing numerical variables GDP, HPA, FX and Y - I am interested to predict Y given some future values of GDP, HPA and FX. - Some variables are non-statioanry as per adf.test() - I wanted to implement a VECM framework for modeling

Re: [R] Linear optimization with quadratic constraints

2017-01-07 Thread Preetam Pal
Hi Guys, Any help with this,please? Regards, Preetam On Thu, Jan 5, 2017 at 4:09 AM, Preetam Pal <lordpree...@gmail.com> wrote: > Hello guys, > > The context is ordinary multivariate regression with k (>1) regressors, > i.e. *Y = XB + Error*, where > Y = n X 1 vector of

[R] Linear optimization with quadratic constraints

2017-01-05 Thread Preetam Pal
Hello guys, The context is ordinary multivariate regression with k (>1) regressors, i.e. *Y = XB + Error*, where Y = n X 1 vector of predicted variable, X = n X (k + 1) matrix of regressor variables(including ones in the first column) B = (k+1) vector of coefficients, including intercept. Say, I

Re: [R] Restricted Simulation from GPD & Normal Distributions

2016-12-27 Thread Preetam Pal
please let me know. On Tue, Dec 27, 2016 at 3:46 PM, Preetam Pal <lordpree...@gmail.com> wrote: > HI R-users, > > I have data on one equity-related variable X, denoted by > x1,x2,x3,...x1000 which has been ordered as x1<x2< identified the upper and lower 5

[R] Unable to Install POT Package for R 3.1.0

2016-11-23 Thread Preetam Pal
Hi, I am trying to install the package POT for R* version 3.1.0* (spring dance), using: *install.packages("POT", repos="http://R-Forge.R-project.org ")* *( link )* *But I am getting the following error:* *package

Re: [R] Output formatting in PDF

2016-10-11 Thread Preetam Pal
Hey Enrico, LaTex is not possible actually. On Tue, Oct 11, 2016 at 2:29 PM, Enrico Schumann <e...@enricoschumann.net> wrote: > On Tue, 11 Oct 2016, Preetam Pal <lordpree...@gmail.com> writes: > > > Hi, > > > > Can you please help me with the following

[R] Output formatting in PDF

2016-10-11 Thread Preetam Pal
Hi, Can you please help me with the following output formatting: I am planning to include 2 plots and some general description in a one-page PDF document, such that - I'll leave some appropriate margin on the PDF- say, 1.5 inches top,right, bottom and left (will decide based on overall

[R] MLE Estimation in Extreme Value Approach to VaR (using Frechet distribution)

2016-09-23 Thread Preetam Pal
cial Time Series*' by Ruey S.Tsay -2nd edition) - - Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Insti

[R] Factor Analysis using weights for each variable

2016-05-26 Thread Preetam Pal
. Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata

[R] Proportion of 1's in terminal nodes of CTREE()

2016-05-26 Thread Preetam Pal
Hi R-users, I have created a Conditional Tree using the ctree function ( in package partykit). The data had a factor - the y variable - and a host of categorical x-variables. Now, I want to find the proportion of cases where y = 1 in each of the terminal nodes. Is it possible to do so

Re: [R] Accessing terminal datasets in Ctree()

2016-05-02 Thread Preetam Pal
Again, really appreciate your help on this. Thanks, Achim. -Preetam On Tue, May 3, 2016 at 3:22 AM, Achim Zeileis <achim.zeil...@uibk.ac.at> wrote: > On Mon, 2 May 2016, Preetam Pal wrote: > > Great, thank you so much Achim.But one issue, in case I do not know how >> many &g

Re: [R] Accessing terminal datasets in Ctree()

2016-05-02 Thread Preetam Pal
<achim.zeil...@uibk.ac.at> wrote: > On Mon, 2 May 2016, Preetam Pal wrote: > > Hi guys, >> >> If I am applying ctree() on a data (specifying some control parameters >> like >> maxdepth), is there a way I can programmatically access the (smaller) >>

[R] Accessing terminal datasets in Ctree()

2016-05-02 Thread Preetam Pal
at the respective node-splitting attributes and write out a filtering function - but clearly too much to ask for if I have a large number of terminal nodes). Intention is to perform regression on each of these terminal datasets. Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] CTree to obtain segmented data

2016-04-30 Thread Preetam Pal
this issue Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata.

[R] Data Issues with ctree/glm and controlling classification parameters

2016-04-30 Thread Preetam Pal
;= 0.5 as a 'negative'. Is there a way I can change this threshold to say, 0.75 instead of whatever R might be using (I used 0.5 as example). Thank you in advance for your help. -Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Stat

[R] Declaring All Variables as Factors in GLM()

2016-04-30 Thread Preetam Pal
if anyone can help me with this (idea is to loop over variable names and use as.factor - but not sure how to do this). Thanks Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114

Re: [R] ACF values with confidence limits + Plot Extaction

2016-03-06 Thread Preetam Pal
Regards, Preetam On Mon, Mar 7, 2016 at 1:03 AM, Jean-Claude Arbaut <arbau...@gmail.com> wrote: > a <- as.ts(rnorm(20)) > png("acf.png") > a.acf <- acf(a) > dev.off() > > # to see what is available > names(a.acf) > unclass(a.acf) > > > 201

Re: [R] ACF values with confidence limits + Plot Extaction

2016-03-06 Thread Preetam Pal
. It also says > that it returns it invisibly if plot = TRUE which I imagine is what you are > doing. > > So try > > res <- acf(insert_parameters_here, plot = FALSE) > > and then look at res > > > > On 06/03/2016 07:40, Preetam Pal wrote: > >> Hi R-

[R] ACF values with confidence limits + Plot Extaction

2016-03-05 Thread Preetam Pal
Hi R-users, I have a time series of residuals and I want to get the ACF (autocorrelation) values till lag = 12, along with the 12 upper/lower confidence limits. I understand that acf(residual) would give me the plot, but I will also need the actual values as an array etc. Plus, I'll have to

[R] OLS Regression on subset of data

2016-02-03 Thread Preetam Pal
Hi, I am performing OLS regression on a dataset involving variables Y, X1 and X2, each having 500 observations. I want to perform the regression only on a subset of the dataset (say, using observations 50 till 350). Is there any way in which I can pass the entire dataset, but somewhere select

[R] Weighted Quantile Regression as a function of Tau and Weights array

2016-01-26 Thread Preetam Pal
I have a dataset (attached) on numeric variables y, gdp, hpa and fx. I intend to perform weighted quantile regression on this data set (i.e. y on the remaining variables) and extract the estimated coefficients. I want to do this as a bivariate function of the quantile tau and the weights array.

Re: [R] Weighted Quantile Regression as a function of Tau and Weights array

2016-01-26 Thread Preetam Pal
Sorry, forgot to attach the data. On Tue, Jan 26, 2016 at 11:56 PM, Preetam Pal <lordpree...@gmail.com> wrote: > I have a dataset (attached) on numeric variables y, gdp, hpa and fx. I > intend to perform weighted quantile regression on this data set (i.e. y on > the rema

Re: [R] Quantile Regression without intercept

2015-10-07 Thread Preetam Pal
r "correct percentages" are only correct when you have an intercept in the > model, > without an intercept there is no gradient condition to ensure that. > > > > > > > >> Date: Mon, 5 Oct 2015 21:14:04 +0530 > >> From: Preetam Pal <lord

[R] Error Correction Model under Cointegration

2015-10-06 Thread Preetam Pal
Hi All, I have a time series y_t and 2 other time series x1_t and x2t as regressors. I know that these 3 series are cointegrated via the Johansen tests. Hence I want to implement an error correction model with 1 lag for each variable (i.e. Lag y, lag x1 and lag x2) for projection purposes

[R] Quantile Regression without intercept

2015-10-05 Thread Preetam Pal
Hi guys, Can you instruct me please how to run quantile regression without the intercept term? I only know about the rq function under quantreg package, but it automatically uses an intercept model. Icant change that, it seems. I have numeric data on Y variable (Gdp) and 2 X variables (Hpa

Re: [R] Quantile Regression without intercept

2015-10-05 Thread Preetam Pal
Yes..it works. Thanks  -Original Message- From: "stephen sefick" <ssef...@gmail.com> Sent: ‎05-‎10-‎2015 09:01 PM To: "Preetam Pal" <lordpree...@gmail.com> Cc: "r-help@r-project.org" <r-help@r-project.org> Subject: Re: [R] Quantile

[R] Johansen Test of Cointegration:How to access rows in R output

2015-10-04 Thread Preetam Pal
Hi guys, I ran ca.jo(data,type="trace", ecdet="none",k=2) i.e. Johansen's Trace test on R-Studio (package: "urca")and got the output below: I have 3 questions about this: A> How do I programmatically access the columns("test", "10pct" etc) in any row corresponding to, say, r < = 1 in the

[R] Weighted Ridge Regression with GCV Optimization

2015-09-22 Thread Preetam Pal
Hi R-users, I am having problems while implementing the following model: 1. I have numerical regressors (GDP, HPA and FX observed quarterly) and need to predict the numerical variable Y. 2. I have to run *weighted Ridge Regression* where the weights of the squared residuals are

Re: [R] Running GCV Optimization under Ridge Regression

2015-09-21 Thread Preetam Pal
h/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ________ > FREE 3D MARINE AQUARIUM SCREENSAVER - Wat

[R] Running GCV Optimization under Ridge Regression

2015-09-21 Thread Preetam Pal
Hi guys, I am running Ridge regression on a dataset (predicted variable = y; GDP, HPA and FX are regressors). I found that lm.ridge() can perform the ridge regression given any value of lambda (i.e. the ridge parameter). However, in order to choose the best results, I need to select the model

[R] Quadratic programming

2015-07-19 Thread Preetam Pal
Hi, If i have a quadratic objective function with a system of linear constraints for multiple variables, is there any inbuilt function that i can use? Regards, Preetam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Multivariate Kernel Regression : Nadaraya-Watson or Gasser-Muller methods

2015-05-27 Thread Preetam Pal
and regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata

[R] Prediction using ARCH

2014-11-15 Thread Preetam Pal
Hi, I have two variables, FTSE100 and CPI . Call them Y and X respectively. I want to fit an ARCH(1) to model Y on X. I also intend to predict the values of Y for future (given) values of X. How can I use R for such prediction? Another question is: is there a way I can call an R function which

[R] Variable selection from given data

2014-10-31 Thread Preetam Pal
Hi, I am doing quantile regression of y on a set of 15 explanatory variables x1, x2,x15. I want to run 15 regression models where in the i-th model, y would be regressed on all x variables except x-i. Then I would compare the results. At this point, I donot know how to create the 15 data

[R] Dropping variables from data set

2014-10-30 Thread Preetam Pal
Hi, I have 15 variables x1, x2, , x15 and I want to create 15 data sets where the i-th data set D-i will be contain all variables except the variable, x-i, for i in 1 to 15. It would be great if someone can help me out with this. I have had very little exposure to R or general coding

[R] CHAID in R

2014-04-24 Thread Preetam Pal
Hi, I want to implement CHAID in R, but at this point am not sure how to go about it. Would be glad if someone please helps me out with it. I am attaching the data set for your perusal. The variable in the 1st column is the dependent variable. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M

[R] Plotting multiple confidence intervals in the same graph

2013-11-21 Thread Preetam Pal
thinking if I can plot the 50 confidence interval in the same graph and may be have a vertical line denoting the hypothetical mean. This will be a good visual representation I think.Can I use different colors as well? I request for your help on this. Thanks and Regards, Preetam -- Preetam Pal

[R] CHAID in R

2013-11-15 Thread Preetam Pal
. -Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata. C1 C2 C3

[R] Renaming variables

2013-09-20 Thread Preetam Pal
line for renaming each variable (eg: X1=score.X1 X2=score.X2 and so on) ? Thanks for your help. Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman

[R] Simulation in R

2013-08-04 Thread Preetam Pal
Hi All, I want to simulate a random variable X which takes values 1 and 0 with probabilities 75% and 25% respectively and then repeat the procedure 1 times. I am sure this is trivial, I tried to look at the help pages online, but I can't quite find it. Appreciate your help. Thanks and

Re: [R] Simulation in R

2013-08-04 Thread Preetam Pal
a better answer since simpler, faster, algorithms are available in that case. Or even as.integer(runif(1) 0.75) Rui Barradas Em 04-08-2013 08:51, Preetam Pal escreveu: Hi All, I want to simulate a random variable X which takes values 1 and 0 with probabilities 75% and 25

[R] scale change

2013-05-21 Thread Preetam Pal
axes: I need to 'stretch' the x-axis and 'shrink' the y-axis (1/2cm on the previous x-axis would now need to be stretched to 1 cm on the new one and exactly the opposite for the y-axis). I am not being able to do this. Any help is welcome. -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] finding moving average order

2013-05-20 Thread Preetam Pal
Hi all, I want to know the moving average order of a time series variable X_t. I know that ar(x) works for the autoregressive order, but ma(x) is not doing the same for moving average.I am not sure where to find the correct function. Any help is appreciated. Thanks, Preetam -- Preetam Pal (+91

[R] arima prediction

2013-05-18 Thread Preetam Pal
till now. Appreciate your help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute

Re: [R] arima prediction

2013-05-18 Thread Preetam Pal
...@sapo.pt wrote: Hello, At an R prompt type ?predict.Arima Hope this helps, Rui Barradas Em 18-05-2013 21:42, Preetam Pal escreveu: Hi all, I have a time series Y which I have modelled as ARIMA(2,0,2) by using the arima function . I want to know the model predicted values so that I

[R] reconstructing original series based on differenced data

2013-05-16 Thread Preetam Pal
Hi all, I have a time series X_t which has been differenced thrice to get Y_t. I know these y values only and nothing else. Is there a function in R which can be used to lead back to the original X_t's? Any help is welcome. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] BASEL II Validation Tests

2013-05-15 Thread Preetam Pal
Hi, I would like to know whether there is any in-built code for the following BASEL II related validation tests: 1Level Test 2 K-Fold Test 3Mobility Test Kindly let me know if I need to supply any more information. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] K Fold CrossValidation

2013-05-15 Thread Preetam Pal
get the coefficients for this model. I am a beginner in R and the help page on CROSSVAL appeared a bit confusing to me. Thanks for any help. Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

[R] Fitting AR(p) model

2013-05-08 Thread Preetam Pal
. I am confused! In this context, how do I interpret the initial output which said order selected 0. Any help is appreciated. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

[R] Inputting white noise values for ARMA prediction

2013-05-08 Thread Preetam Pal
in practice. Appreciate your help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute

[R] ARMA(p,q) prediction with pre-determined coefficients

2013-05-08 Thread Preetam Pal
to know exactly how to fix the coefficients to run the prediction model and get the values of Loss_22,23,.. and so on. The link to the help-page is as below: http://stat.ethz.ch/R-manual/R-devel/library/stats/html/arima.html Appreciate your help. Thanks, Preetam -- Preetam Pal (+91

[R] plotting 2 time series data on the same graph

2013-05-04 Thread Preetam Pal
Hi all, I have 2 time series variables : X_t and Y_t where t=0,1,2,...,100 I want a plot containing the line charts( time plotted on the x-axis) for both these variables. -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114

[R] Multiple Line Plots in the same graph

2013-05-04 Thread Preetam Pal
help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata

[R] Lasso Regression error

2013-05-04 Thread Preetam Pal
the same error when instead of the matrix of predictor variables, I am using only a single variable, say, g : lasso=lars(g,l)] Appreciate any help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

Re: [R] Lasso Regression error

2013-05-04 Thread Preetam Pal
of coef(lasso). Am I right? Plus what happens to the intercept estimate? It is not available in coef(lasso). Any help is welcome. Thanks, Preetam On Sat, May 4, 2013 at 9:52 PM, David Winsemius dwinsem...@comcast.netwrote: On May 4, 2013, at 6:09 AM, Preetam Pal wrote: Hi all, I have a data

Re: [R] Lasso Regression error

2013-05-04 Thread Preetam Pal
, May 5, 2013 at 12:55 AM, David Winsemius dwinsem...@comcast.netwrote: On May 4, 2013, at 10:13 AM, Preetam Pal wrote: Hi, I rectified my error (thanks David for pointing it out) Now I have been able to run the code: data=read.table(data.txt, header=T) l=data$LOSS h=data$HPI u

[R] Likelihood

2013-05-03 Thread Preetam Pal
of freedom Multiple R-squared: 0.9528,Adjusted R-squared: 0.944 F-statistic: 107.8 on 3 and 16 DF, p-value: 7.989e-11 Thanks and regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

[R] saving a matrix

2013-05-02 Thread Preetam Pal
randomly generated by R). How can I save and call this matrix in the later sessions as well? Appreciate your help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

[R] ARMA with other regressor variables

2013-05-02 Thread Preetam Pal
to know what technique R employs to find the estimates? Any help is appreciated. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall

[R] warnings in ARMA with other regressor variables

2013-05-02 Thread Preetam Pal
0.2221 2e-04 NaN sigma^2 estimated as 3.921e-06: log likelihood = 311.72, aic = -609.44 Warning message: In sqrt(diag(x$var.coef)) : NaNs produced What does this output mean? How do I get rid of this and do my analysis properly? Any help is welcome. Thanks, Preetam -- Preetam

[R] Ridge regression

2013-04-30 Thread Preetam Pal
values in R (may be we need to go back to the reg= lm.ridge model corresponding to each final beta estimate, but I am not sure how to do this through code) Kindly tell me if any further details are needed. Thanks for your help. Regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] ADF test --time series

2013-04-30 Thread Preetam Pal
ARMA(p,q) model are *p=2* (as lag order in the output is 2) and *q=0*;.i.e. the *AR coefficients for X(t-1) and X(t-2) are significant*, while those of X(t-3) onwards are insignificant. Appreciate your help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year

[R] Arma - estimate of variance of white noise variables

2013-04-29 Thread Preetam Pal
)? Appreciate your help. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S

[R] Selecting ridge regression coefficients for minimum GCV

2013-04-27 Thread Preetam Pal
into consideration that lambda which minimizes the GCV. Kindly advise me how I can proceed. Thanks and regards, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division

[R] Regression coefficients

2013-04-26 Thread Preetam Pal
-- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata. [[alternative HTML version

[R] Bootstrapping in R

2013-04-25 Thread Preetam Pal
-- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata. [[alternative HTML

[R] Selecting and then joining data blocks

2013-04-25 Thread Preetam Pal
? Basically, I am doing bootstrapping , but the observations are actually 4X5 matrices. Appreciate your help. Thanks, Preetam --- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division