Re: [R] Help request from Ph.D. Students

2016-01-11 Thread Mohammed Ouassou
Try DLM package :

 dlm: Bayesian and Likelihood Analysis of Dynamic Linear Models

M.O

On Mon, 2016-01-11 at 13:07 +0100, Franklin Bretschneider wrote:
> Dear NECMETTİN ALPAY KOÇAK,
> 
> Re:
> 
> > Dear All,
> > I am Ph.D. student in Econometrics. My thesis is about "Linear Filtering on 
> > a Time Series"  which R has already a nice package, namely "Filter". This 
> > package is really helpful for my study. But, I really help from you to 
> > create two filter using with "filter" package.
> > I want to create two filter desribed in attachment (effects word file) 
> > using "filter" package. But, I dont know how?
> > 
> > I really need your reply,
> > Sincerely,
> > 
> > Alpay KOCAK
> > (etc...)
> 
> 
> I don't know a package called "filter", but a function "filter" is in the 
> "stats" package
> There are however more packages to filter time data. I use "signal", which 
> also has a "filter" function in addition to functions to design filters 
> yourself (from simple first-order to higher-order butterworth etc).
> This package is intended to filter (electrical) signals, but might be used 
> for any time series.
> In addition, there are several packages for the analysis of seasonal data. 
> You might search CRAN for the names.
> Success and
> Best Wishes,
> 
> 
> Frank
> --
> 
> 
> 
> Franklin Bretschneider
> Dept of Biology
> Utrecht University
> brets...@xs4all.nl
> 
> __
> R-help@r-project.org 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.

__
R-help@r-project.org 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.

[R] Cramer Rao upper/lower bounds- No Comments ?

2014-04-25 Thread Mohammed Ouassou
Dear R users;

I have a question about Cramer Rao upper/lower bounds

Is it possible to compute Crammer Rao upper/lower bounds from residuals
and  corresponding covariance matrices ?


Any suggestions will be appreciated, thanks in advance.


M.O

__
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.


[R] Cramer Rao upper bound computation

2014-04-24 Thread Mohammed Ouassou
 Dear R users;

I have a question about Cramer Rao upper/lower bounds

Is it possible to compute Crammer Rao upper/lower bounds from residuals
and  corresponding covariance matrices ?


Any suggestions will be appreciated, thanks in advance.


M.O

__
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.


Re: [R] plotting points over a map using R

2014-01-31 Thread Mohammed Ouassou
library(RgoogleMaps);   # download a static map from the Google server
library(geomapdata);# Topographic and Geologic Mapping
lbrary(PBSmapping); # Draw Maps and Implement Other GIS Procedures

STEP1:
my_map = GetMap(center=my_center, zoom =my_zoom ,
destfile=my_out_file ,maptype = mapmaker-hybrid,
size=c(640,640));

?GetMap for more info

STEP2: You can add text
= 
tmp = TextOnStaticMap(my_map,lat = my_markers_1[,lat], 
lon = my_markers_1[,lon],
labels=as.character(site_names), 
col=red, cex=1.1, add=F)

# STEP 3: you can add points 
tmp = PlotOnStaticMap(my_map,lat = my_markers[,lat], 
lon = my_markers[,lon], cex=2.,pch=10,col=c(black),
add=T)
add=T is importent

# STEP 4: You can add lines 
tmp = PlotOnStaticMap(my_map,lat = my_markers_2[,lat], lon =
my_markers_2[,lon], col=c(blueviolet), add=T, 
FUN = lines, lwd = 3);


I hope will help !


Mohammed




On Fri, 2014-01-31 at 09:58 +, 李德磊 wrote:
 Hello everyone,
 I have no idea how to plotting points over a map using R, in which the colors 
 of the points stand for the points' value. I'd like to get a map as shown in 
 attachment picture which was plotted using matlab. Does anyone know how to do 
 it using R?  Thank you very much for your help in advance.  
 Kind regards,Dli
 __ 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.

__
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.


Re: [R] help with kriging interpolation

2013-04-05 Thread Mohammed Ouassou
Hei,


Non-parametric linear spatial interpolation algorithm Ordinary Kriging
using geoR package

library(geoR)

# 1. Create a geodata object (wMatrix contains coords and data 
#   ? as.geodata  --- for more info 
 my_geoData - as.geodata(wMatrix, coords.col=1:2, data.col=3);

# 2. Create a variogram objects .
# ? variog --- for more info  
my_variog - variog(my_geoData , estimator.type = c(modulus),
max.dist= 28, uvec=seq(0,60,by=3 ), messages=FALSE);

# 3. Try to delete all dupl. in you data
my_dup =  dup.coords(my_geoData$coords);

# 4. Parameter Estimation: sill, range and the nugget
# Use MLE or WLS (?likfit  OR ?variofit) 

reml - likfit(my_geoData, cov.model = wave,  trend =
cte,ini=c(my_sigmaSqrt,my_phi), fix.nugget=T,
nugget=my_nygget,lik.method = REML,messages=F); 

wls - variofit(my_variog, ini = c(0.185, 4.05), cov.model = mat, kap
= .5, fix.nugget=T,nug = my_nygget); 

# IMPORTENT : before callingvariofit() OR likfit() 
# eyefit() to get appropriate init. value and covariance
#  function 



# 5. Perform geostatistical spatial interpolation Ord. Krig (OK)
#  myPredArea: can be a single point  OR a matrix 
ordKrig - krige.conv(my_geoData,
locations=myPredArea,krige=krige.control(obj.m=wls, type.krige = ok));
 

# 6.  Get the predicted value and corresponding variance. 
ok_pred  - cbind(myPredArea,ordKrig$predict, ordKrig$krige.var);



Mohammed Ouassou 

On to., 2013-04-04 at 00:37 -0700, Jeff Newmiller wrote:
 I am no expert on kriging, but I do know that your question desperately needs 
 a reproducible example [1] that illustrates the actual problem you are 
 encountering.
 
 [1] 
 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 --- 
 Sent from my phone. Please excuse my brevity.
 
 Alfred Oswago numeros2...@gmail.com wrote:
 
 All,
 I am new to using R and know some basics.  I wish to use kriging in R
 to
 do the following:
 
 given  data Y =f(X1,X2,X3,.,Xn) --1000+ irregular measured data
 set.
 
 I would like to be able to get a single value  y given  sinle input set
 (x1,x2,x3,...xn)
 
 A google search on this takes me lierally to the same example on
 involving
 analysis with soil sampling and I cannot figure out how to extract
 single
 point interpolant.
 
 Any examples or pointers appreciated,
 Numeris.
 
  [[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.
 
 __
 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.

__
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.


Re: [R] ROCR package not installing

2012-11-22 Thread Mohammed Ouassou
try:
   install.packages(ROCR,dep=T)

M.O

On to., 2012-11-22 at 16:02 +1000, Philip Robinson wrote:
 I have tried installing the package (ROCR) with this command:
 
  
 
 Install.packages(ROCR)
 
  
 
 And with this command on the command line
 
  
 
 R CMD INSTALL ROCR_1.0-4.tar.gz
 
  
 
 But both times I get exactly the same error shown below, I don't understand
 what is wrong, is this an error in the package code?
 
  
 
 Thank you
 
 Philip
 
  
 
 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ R CMD INSTALL
 ROCR_1.0-4.tar.gz
 
 * installing to library
 
 '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10'
 
 * installing *source* package 'ROCR' ...
 
 ** R
 
 ** data
 
 ** demo
 
 ** preparing package for lazy loading
 
 Loading required package: gtools
 
 Loading required package: gdata
 
 gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
 
  
 
 gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.
 
  
 
 Attaching package: 'gdata'
 
  
 
 
 
   The following object(s) are masked from package:utils :
 
  
 
   object.size 
 
  
 
 Loading required package: caTools
 
 Loading required package: bitops
 
 Loading required package: grid
 
 Loading required package: KernSmooth
 
 KernSmooth 2.23 loaded
 
 Copyright M. P. Wand 1997-2009
 
  
 
 Attaching package: 'gplots'
 
  
 
 
 
   The following object(s) are masked from package:stats :
 
  
 
   lowess 
 
  
 
 Error in setMethod(plot, signature(x = performance, y = missing),  : 
 
   no existing definition for function plot
 
 Error : unable to load R code in package 'ROCR'
 
 ERROR: lazy loading failed for package 'ROCR'
 
 * removing '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10/ROCR'
 
 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ 
 
  
 
 
 
 
 
 
 
 
   [[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.

__
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.


Re: [R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread Mohammed Ouassou
try :

sessionInfo() 

M.O

On ti., 2012-11-13 at 11:12 +, HJ YAN wrote:
 Dear R users
 
  I tried an example earlier to check the results using two different
 methods of clustering with same data set, and for both methods, say method
 A and method B. Also I decided to have same number of groups/clusters (here
 8 was chosen).
 
 I found a good graphical tool in R to compare the distribution of the
 number in each group/cluster created by method A and method B, e.g. how
 many of the individuals are clustered as 'Group 1' both by method A and B,
 and how many are clustered as 'Group 2' both by method A and B and so on.
 In this case we have 30 and 28 respectively (please see attached table and
 plot).
 
 I lost my code and can not remember which packages/functions I used here?
  Could anyone recognize and give me some clue? I only made a note
 'crosstable' if can ring your bell...
 
 Many thanks in advance
 
 HJ
 __
 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.

__
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.


[R] testing two data sets

2012-02-21 Thread Mohammed Ouassou
Hi everyone,

I have 2 data sets and I like to carry out a test to find out if they
come from the same distribution.


Any suggestions ? thanks in advance.

M.O




  

__
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.


Re: [R] Help to get fitted and residual value

2011-12-07 Thread Mohammed Ouassou
Hei,

i) get names of object returned by lm(). in this case fit 
  names(fit)

  output from command : names(fit)
   [1] coefficients  residuals effects   rank 
  [5] fitted.values assignqrdf.residual  
  [9] contrasts xlevels   call  terms

ii) To get residuals, enter the command 
myFitRes - fit$residuals;

iii) myFitVals - fit$fitted.values


I hope will help,
M.O

On ti., 2011-12-06 at 22:20 -0800, arunkumar wrote:
 Data- read.csv(C:/FE and RE.csv)
 Formula=Y~X2+X3+X4 + X5+X6
 fit=lm(formula=Formula,data=Data)
 
 My sample Data
 
 State Year Y X2 X3 X4 X5 X6
 S2 1960 27.8 397.5 42.2 50.7 78.3 65.8
 S1 1960 29.9 413.3 38.1 52 79.2 66.9
 S2 1961 29.8 439.2 40.3 54 79.2 67.8
 S1 1961 30.8 459.7 39.5 55.3 79.2 69.6
 
 Is there any way to fitted and residual for the new set of data. or should i
 create formula manually and pass the values individually
 
 
 S2 1962 31.2 492.9 37.3 54.7 77.4 68.7
 S1 1962 33.3 528.6 38.1 63.7 80.2 73.6
 S2 1963 35.6 560.3 39.3 69.8 80.4 76.3
 
 
 
 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Help-to-get-fitted-and-residual-value-tp4167808p4167808.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 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.

__
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.


Re: [R] how to read a group of files into one dataset?

2011-08-25 Thread Mohammed Ouassou
inputDataPath  - /home/.../bla/;  #Directory containing data files 
szPattern  -  .dat;   # File extension 

# Get all files name in the specified directory
file2process - list.files(inputDataPath, pattern=szPattern); 

 # Get number of files to be processed  
iFileCnt - length(file2process);  
dbMatrix - list();  # Empty list (Your local database)
for (i in 1:iFileCnt)
{
   dataFile - sprintf(%s%s, inputDataPath, file2process[i]);
   dbMatrix[i]  - dataFile;
}
ldb - lapply(dbMatrix, read.table, header = T);

local database ldb is an array of matrix, each matrix contains 1 data
file.

 # Get the matrix from list(local database)
 Mat - as.matrix(ldb[[i]]);



I hope this will help !



On to., 2011-08-25 at 11:43 +0200, Eik Vettorazzi wrote:
 Hi Jie,
 you have to merge the sequential data.frames, and depending on the
 structure of your inputs  and the way you want your resulting data.frame
 (which you both didn't specify) either ?merge  or ?rbind should help.
 
 cheers
 
 
 Am 25.08.2011 10:17, schrieb Jie TANG:
  for example : I have files with the name
   ma01.dat,ma02.dat,ma03.dat,ma04.dat,I want to read the data in
  these files into one data.frame
  
  flnm-paste(obs,101:114,_err.dat,sep=)
  newdata-read.table(flnm,skip=2)
  data-(flnm,skip=2)
  but the data only contains data from the flnm[1]
  I  also tried as below :
  for (i in 1:9) {
  data-read.table(flnm[i],skip=2)
  }
  
  
  but i failed how could I modified my script?
  
  is there any advices?
  --
  
  [[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.
 

__
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.


[R] Fiting a trend + periodic signal

2010-08-12 Thread Mohammed Ouassou
Dear all,
I have a time series and I like to fit S(t) = T(t) + P(t) 

 T(t) = Linear Trend =  a + bt 
 P(t) = Periodic Signal = sum(Ai*cos(wt) + Bi*sin(wt) ) for i=1,...,3.



Thanks in advance,

Best  regards,

__
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.


[R] geoR - likfit failure

2010-08-04 Thread Mohammed Ouassou
Hi

I'm using geoR package to perform linear spatial interpolation(OK).
The function likfit() fails to compute REML.

The error meassage is : Error in solve.default(v$varcov, xmat);


How I can find out that likfit() is failed to process and retrieving the error 
message ?

 
Thank you so much for your help.

__
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.