Pspline program

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pspline program

R help mailing list-2
Hi,
I would like help from knowledgeble mai-listers in pspline matter.I just a beginner.
I have the following pspline program and I get strange (for me) results like :17.172881859251717.17297751018117.173073161111917.173168812047817.173264462992617.1733601139499for all file.
The file haveĀ 20234 data and keep 20234 data after processing by pspline.

library(sm)
library(pspline)
#Importing the dataset and converting into a matrix form#hist.df <- read.table('b1_27.txt', header=FALSE,col.names=c("A"), dec=".")
hist.df <- read.table("C:\\Users\\.....\\Desktop\\Pspline\\b1_27.txt", header=FALSE,col.names=c("A"), dec=".")
data <- as.matrix(hist.df$A,ncol=1)
#Getting a non-decreasing predictor variablex = c(1:20234)
#Fitting the pspline function, note that it will be a normal smoothing with order=2 and df = 4, method = 2 means degrees = df
res = smooth.Pspline(x,data,norder = 2,df=4,method=2)res
#Plotting the normal plot for the fitted values
sm.density(res$ysmth,model="normal")
setwd("C:\\Users\\....\\Desktop\\Pspline")
#writing the output into a tablewrite.table(res$ysmth, file = "b1_27_psp.txt", col.names = F,quote=F,row.names=F)
Thank you for your help.
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/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.

b1_27.txt (96K) Download Attachment