Hi,

I have a 324X15 matrix (No of years vs. heavy precipitation days) and I want
to calculate the cdf at 5 different data points for each row. I tried by the
following codes but it's not working.

heavyprec <- read.csv (file="heavyprecdays_CSV.csv",header=TRUE,sep=",")
a <- heavyprec
pdf <- density (a, bw="SJ", kern= "gaussian")
f <- approxfun (pdf$x, pdf$y)
cdf <- integrate (f, -Inf, 25.25)     # I also have to calculate cdf at 30,
33, 37 heavy precipitation days

I know I am misunderstanding the code somewhere. But not being able to
figure it out. Basically I want to calculate bandwidth for each of the 324
rows separately and then I need to calculate the kernel sensity estimate for
each of 324 rows separately and cdf for all those rows separately at 5
different data points. So I guess I have to use for loops too?

This is my 1st  program in R and I am sorry if this problem sounds very
easy.

Any suggestions and help would be highly appreciated!
Thanks very much in advance!






-- 
Tarana Solaiman
PhD Candidate,
Dept. of Civil & Environmental Engineering
The University of Western Ontario
London, ON, Canada
Email: tarana.solai...@gmail.com

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to