similar to: Simulate data for spline/piecewise regression model

Displaying 20 results from an estimated 200 matches similar to: "Simulate data for spline/piecewise regression model"

2008 Jan 04
2
R2WinBUGS sending variables as factors
Hello R and BUGS users, I am writing a heirarchical model in R to send to BUGS via R2WinBUGS and I am finding it difficult to get the model to run. I seem to be having two problems. 1) I can't seem to send variables classed as factors (Month), is there a way do this? 2) Checking the Log in WinBUGS I can see that the model is Syntactically correct, but Bugs is not able to recognise the the
2011 Dec 01
1
Estimation of AR(1) Model with Markov Switching
Dear R users, I have been trying to obtain the MLE of the following model state 0: y_t = 2 + 0.5 * y_{t-1} + e_t state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t where e_t ~ iidN(0,1) transition probability between states is 0.2 I've generated some fake data and tried to estimate the parameters using the constrOptim() function but I can't get sensible answers using it. I've tried using
2006 May 19
0
how to estimate adding-regression GARCH Model
---------- Forwarded message ---------- From: ma yuchao <ma.yuchao@gmail.com> Date: 2006-5-20 ÉÏÎç4:01 Subject: hello, everyone To: R-help@stat.math.ethz.ch Hello, R people: I have a question in using fSeries package--the funciton garchFit and garchOxFit if adding a regression to the mean formula, how to estimate the model in R? using garchFit or garchOxFit? For example,
2009 Jan 10
2
Print specific matrix value???
Hello All, I'm trying to print specific row and column for Observed_Scores matrix, however, when I execute the command "Observed_Scores[1,1]", I get the message "Error in Observed_Scores[1, 1] : incorrect number of dimensions". Could you please help and let me know where is the mistake? Here is my program: library(ltm) library(psych) # Settting the working directory
2009 Jan 28
1
stack data sets
Hi All, I'm generating 10 different data sets with 1 and 0 in a matrix form and writing the output in separate files. Now I need to stack all these data sets in one vector and I know that stack only operates on list or data frame however I got these data sets by converting list to a matrix so can't go backwards now. Is there a way i can still use Stack? Please see the program:
2009 Jan 28
0
How to stack data sets?
Hi All, I'm generating 10 different data sets with 1 and 0 in a matrix form and writing the output in separate files. Now I need to stack all these data sets in one vector and I know that stack only operates on list or data frame however I got these data sets by converting list to a matrix so can't go backwards now. Is there a way i can still use Stack? Please see the program:
2016 Apr 18
0
R [coding : do not run for every row ]
Always keep the mailing list in cc. The code runs for each row in the data. However I get the feeling that there is a mismatch between what you think that is in the data and the actual data. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070
2016 Apr 18
0
R [coding : do not run for every row ]
Dear anonymous, The big mistake in the output might be obvious to you but not to others. Please make clear what the correct output should be or at least what is wrong with the current output. And please DO read the posting guide which asks you not to post in HTML. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie &
2016 Apr 18
3
R [coding : do not run for every row ]
Hi, i am sorry, the output should be values between 0 and 0.1 and not supposed to be 1.00, it is because they are type 1 error rate. And now i get output 1.00 for several samples,rhis is no correct. The loop do not run for every row. i do not know where is my mistake. As i use the same concept on normal distribution setup, i get the result. Sent from my phone On Thierry Onkelinx
2016 Apr 18
0
R [coding : do not run for every row ]
You can make this much more readable with apply functions. result <- apply( all_combine1, 1, function(x){ p.value <- sapply( seq_len(nSims), function(sim){ gamma1 <- rgamma(x["m"], x["sp(skewness1.5)"], x["scp1"]) gamma2 <- rgamma(x["n"], x["scp1"], 1) gamma1 <- gamma1 -
2016 Apr 17
2
R [coding : do not run for every row ]
i have combined all the variables in a matrix, and i wish to conduct a simulation row by row. But i found out the code only works for the every first row after a cycle of nine samples. But after check out the code, i don know where is my mistake... can anyone pls help .... #For gamma disribution with equal skewness 1.5 #to evaluate the same R function on many different sets of data
2016 Apr 19
0
problem on simulation code (the loop unable to function effectively)
Hi Jeem, First, please send questions like this to the help list, not me. I assume that you are in a similar position to sjtan who has been sending almost exactly the same questions. The problem is not in the loops (which look rather familiar to me) but in your initial assignments at the top. For instance: scale parameter=(1,1.5,2,2.5,3) produces an error which has nothing to do with the
2010 Sep 16
4
Pesky homemade function code
Hi all- this seems to be simple to figure out but since im new to writing functions I dont know what is happening. Here is my code along with the error I am receiving: semivario=function(data,ids,times,resids){ id=unique(data$ids) index=combinations(length(data$times[data$ids==id[1]]),2) time=gamma=numeric(dim(index)[1]) for (j in 1:dim(index)[1]){
2016 Apr 19
0
problem on simulation code (the loop unable to function effectively)
Hi Si Jie, Again, please send questions to the list, not me. Okay, I may have worked out what you are doing. The program runs and produces what I would expect in the rightmost columns of the result "g". You are storing the number of each test for which the p value is less than 0.05. It looks to me as though the objects storing the results should be vectors as you are only storing 100 p
2007 Nov 12
0
Resid() and estimable() functions with lmer
Hi all, Two questions: 1. Is there a way to evaluate models from lmer() with a poisson distribution? I get the following error message: library(lme4) lmer(tot.fruit~infl.treat+def.treat+(1|initial.size),family=poisson)->model plot(fitted(model),resid(model)) Error: 'resid' is not implemented yet Are there any other options? 2. Why doesn't the function estimable() in gmodels
2009 Jan 15
2
Interface to open source Reporting tools
Hi, I am a new user of R 2.8.1. I use Tinn-R for code editing. I use a windows 2003 system with 1 GB RAM. I am interested to generate dashboard and reports based on data from MS Access. These reports need to be posted on a weekly basis to the web. The reporting interface should provide facilities for "what if" scenarios. Is it possible to interface R analysis results to good open
2007 Nov 14
0
Piecewise Linear Regression
Hi, Let me pick up this old thread. How does one extract the locations of the knots (ends of the segments) from the fit object below? Thanks, Vadim >From : roger koenker < roger_at_ysidro.econ.uiuc.edu > Date : Tue 31 May 2005 - 10:23:19 EST It is conventional to fit piecewise linear models by assuming Gaussian error and using least squares methods, but one can argue that
2011 Jul 06
0
Piecewise distribution function estimation with Generalized Pareto for tail
Hello all, I am trying to estimate the cumulative distribution function for a single stock return time series. A piecewise estimation is composed of three parts: parametric generalized Pareto (GP) for the lower tail (10% of the observation), non-parametric kernel-smoothed interior (80% of the observations), and GP for the upper tail (10%). I wonder if anyone has clue about this in R. The
2007 May 08
1
Piecewise cubic Hermite interpolation
Which function implements the piecewise cubic Hermite interpolation? I am looking for equivalent of matlab's interp1 with the method = 'pchip' Here is the reference http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/interp1.html& -- View this message in context:
2010 Jan 07
0
piecewise regression using nlme function
Is a 95% CI on a breakpoint fixed effect legitimate when the nonlinear equation is continuous but not differentiable at the breakpoint? I used the nlme to generate a non-linear mixed-effects piecewise model with initial slope zero prior to an unknown breakpoint. It did give a 95% CI for the breakpoint. Thanks Erik whole model is complex, but here is the simple equation used: