[R] fitting gam with constraints on parameters in mgcv

2022-10-22 Thread Chris Wilcox
Hi all, I am trying to fit a gam using mgcv which has a mix of smooth and parametric terms. The model is for some count data on fish catches. I am modelling variation in location and time, but also differences among individual operators. I am interested in the differences in operators specif

[R] Fitting Mixed Distributions in the fitdistrplus package

2020-10-23 Thread Christophe Dutang
gam, fpar, fmixgam)) > > -- Forwarded message - > From: Charles Thuo > Date: Wed, Oct 21, 2020 at 12:03 AM > Subject: [R] Fitting Mixed Distributions in the fitdistrplus package > To: > > > Dear Sirs, > > The below listed code fits a gamma and a pare

Re: [R] Fitting Mixed Distributions in the fitdistrplus package

2020-10-21 Thread aBBy Spurdle , ⍺-Male
dmixgampar <- function (x, param1, param2, ...) { #compute density at x } On Wed, Oct 21, 2020 at 8:03 PM Charles Thuo wrote: > > Dear Sirs, > > The below listed code fits a gamma and a pareto distribution to a data set > danishuni. However the distributions are not appropriate

[R] Fitting Mixed Distributions in the fitdistrplus package

2020-10-21 Thread Charles Thuo
Dear Sirs, The below listed code fits a gamma and a pareto distribution to a data set danishuni. However the distributions are not appropriate to fit both tails of the data set hence a mixed distribution is required which has ben defined as "mixgampar" as shown below. library(fitdistrplus) x<-

Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
I have been using nlsr() to fit s curves to Covid-19 data over the past few weeks and I have not had any issues. Bernard Sent from my iPhone so please excuse the spelling!" > On May 13, 2020, at 5:16 PM, Abby Spurdle wrote: > > Hi Christofer, > > This doesn't really answer your question. > B

Re: [R] Fitting Richards' curve

2020-05-13 Thread Abby Spurdle
> It's possible that Martin's package, cobs, can do this, but not sure, > I haven't tried it. > And there may be other R packages for fitting splines/smoothers to > data, subject to shape constraints. Further to my previous post. I read through the documentation for the cobs package. And (someone

Re: [R] Fitting Richards' curve

2020-05-13 Thread Abby Spurdle
Hi Christofer, This doesn't really answer your question. But if the goal is to fit an S-shaped curve to data, with increased flexibility... (I'm assuming that's the goal). ...then I'd like to note the option of splines (or smoothing), subject to shape constraints... My guess, is it's probably ea

Re: [R] Fitting Richards' curve

2020-05-13 Thread J C Nash
Many moons ago (I think early 80s) I looked at some of the global optimizers, including several based on intervals. For problems of this size, your suggestion makes a lot of sense, though it has been so long since I looked at those techniques that I will avoid detailed comment. I've not looked to

Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
Also, in the full curve referenced on Wikpedia, the parameters Q And M are confounded - you only need one or the other But not both. If you are using both and trying to estimate them both you will have problems. I have fitted these curves quite easily using the Solver in Excel. Bernard Sent fro

Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
John, have you ever looked at interval optimization as an alternative since it can lead to provably global minima? Bernard Sent from my iPhone so please excuse the spelling!" > On May 13, 2020, at 8:42 AM, J C Nash wrote: > > The Richards' curve is analytic, so nlsr::nlxb() should work better

Re: [R] Fitting Richards' curve

2020-05-13 Thread J C Nash
The Richards' curve is analytic, so nlsr::nlxb() should work better than nls() for getting derivatives -- the dreaded "singular gradient" error will likely stop nls(). Also likely, since even a 3-parameter logistic can suffer from it (my long-standing Hobbs weed infestation problem below), is th

Re: [R] Fitting Richards' curve

2020-05-13 Thread Peter Dalgaard
Shouldn't be hard to set up with nls(). (I kind of suspect that the Richards curve has more flexibility than data can resolve, especially the subset (Q,B,nu) seems highly related, but hey, it's your data...) -pd > On 13 May 2020, at 11:26 , Christofer Bogaso > wrote: > > Hi, > > Is there a

Re: [R] Fitting Richards' curve

2020-05-13 Thread PIKAL Petr
Hi Christofer Try FlexParamCurve or maybe drc package. Cheers Petr > -Original Message- > From: R-help On Behalf Of Christofer Bogaso > Sent: Wednesday, May 13, 2020 11:26 AM > To: r-help > Subject: [R] Fitting Richards' curve > > Hi, > > Is the

[R] Fitting Richards' curve

2020-05-13 Thread Christofer Bogaso
Hi, Is there any R package to fit Richards' curve in the form of https://en.wikipedia.org/wiki/Generalised_logistic_function I found there is one package grofit, but currently defunct. Any pointer appreciated. __ R-help@r-project.org mailing list -- T

[R] fitting functional autoregresive model

2019-05-06 Thread Faheem Jan via R-help
Hi, i trying to  extend the functional autoregressive model one FAR(1) to fit the functional autoregressive model of order two FAR(2). the coding i do for far(1) is library(fda)library(far)# CREATE DUMMY VARIABLESfactor2dummy=function(x){  n=length(x)  tab=as.factor(names(table(x)))  p=length(t

Re: [R] Fitting Production Curves

2018-09-21 Thread Bert Gunter
This list doesn't do statistics -- it does R programming, though statistics does occur incidentally sometimes in that context. Not in your post though. You should post on a statistics site like stats.stackexchange.com for statistics questions. Cheers, Bert Bert Gunter "The trouble with having an

[R] Fitting Production Curves

2018-09-20 Thread mikorym via R-help
Hi All, By a production curve I mean for example the output of a mine, peak oil production or the yield of a farm over time within the same season. It is this last example that we should take as the prototypical case. What I would like to do is to fit a curve that inherits qualities of the dis

[R] Fitting problem for Cox model with Strata as interaction term

2018-05-08 Thread wong jane
Dear All, I got a warning message "X matrix deemed to be singular" in Cox model with a time dependent coefficient. In my analysis, the variable "SEX" is a categorical variable which violate the PH assumption in Cox. I first used the survSplit() function to break the data set into different time i

[R] Fitting survival trees with competing risk

2018-04-25 Thread Mario Petretta
Dear all, I'm interested in fitting survival trees with competing risk analysis. The tree should show the cumulative incidence function for each terminal node . I read several paper illustrating this possibility, but to the best of my knowledge no R code are reported. There is any R pa

Re: [R] Fitting Beta Distribution

2017-12-22 Thread peter dalgaard
Stop right there and rethink! The normalization factor depends on the parameter that you are maximizing over. -pd > On 21 Dec 2017, at 11:29 , Lorenzo Isella wrote: > > In the code, dbeta1 is the density of the beta distribution for > shape1=shape2=shape. > In the code, dbeta2 is the same quan

[R] Fitting Beta Distribution

2017-12-21 Thread Lorenzo Isella
I answer my own question: I had overlooked the fact that the normalization factor is also a function of the parameters I want to optimise, hence I should write dbeta2 <- function(x, shape){ res <- x^(shape-1)*(1-x)^(shape-1)/beta(shape, shape) return(res) } after which the results ar

[R] Fitting Beta Distribution

2017-12-21 Thread Lorenzo Isella
Dear All, I need to fit a custom probability density (based on the symmetric beta distribution B(shape, shape), where the two parameters shape1 and shape2 are identical) to my data. The trouble is that I experience some problems also when dealing with the plain vanilla symmetric beta distribution.

Re: [R] fitting cosine curve

2017-06-21 Thread Charles C. Berry
On Wed, 21 Jun 2017, J C Nash wrote: Using a more stable nonlinear modeling tool will also help, but key is to get the periodicity right. The model is linear up to omega after transformation as Don and I noted. Taking a guess that 2*pi/240 = 0.0262 is about right for omega: rsq <- function

Re: [R] fitting cosine curve

2017-06-21 Thread J C Nash
Using a more stable nonlinear modeling tool will also help, but key is to get the periodicity right. y=c(16.82, 16.72, 16.63, 16.47, 16.84, 16.25, 16.15, 16.83, 17.41, 17.67, 17.62, 17.81, 17.91, 17.85, 17.70, 17.67, 17.45, 17.58, 16.99, 17.10) t=c(7, 37, 58, 79, 96, 110, 114, 127, 146, 156,

Re: [R] fitting cosine curve

2017-06-20 Thread Don Cohen
If you know the period and want to fit phase and amplitude, this is equivalent to fitting a * sin + b * cos > >>> > I don't know how to set the approximate starting values. I'm not sure what you meant by that, but I suspect it's related to phase and amplitude. > >>> > Besides, does the method

Re: [R] fitting cosine curve

2017-06-20 Thread Charles C. Berry
On Tue, 20 Jun 2017, lily li wrote: Hi R users, I have a question about fitting a cosine curve. I don't know how to set the approximate starting values. See Y.L. Tong (1976) Biometrics 32:85-94 The method is known as `cosinor' analysis. It takes advantage of the *intrinsic* linear

Re: [R] fitting cosine curve

2017-06-20 Thread lily li
I'm trying the different parameters, but don't know what the error is: Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates Thanks for any suggestions. On Tue, Jun 20, 2017 at 7:37 PM, Don Cohen wrote: > > If you know the period and want to fit

Re: [R] fitting cosine curve

2017-06-20 Thread lily li
Thanks. I will do a trial first. Also, is it okay to have the datasets that have only part of the cycle, or better to have equal or more than one cycle? That is to say, I cannot have the complete datasets sometimes. On Tue, Jun 20, 2017 at 7:37 PM, Don Cohen wrote: > > If you know the period and

Re: [R] fitting cosine curve

2017-06-20 Thread Jim Lemon
What I did was to plot your initial values, then plot the smoothed values and guess the constants. That is, I got an "eyeball" fit to the smoothed values. As I have described this as "gross cheating" in the past, you should either split your data, estimate on one subset and then test on another, or

Re: [R] fitting cosine curve

2017-06-20 Thread lily li
Thanks, that is cool. But would there be a way that can approximate the curve by trying more starting values automatically? On Tue, Jun 20, 2017 at 5:45 PM, Jim Lemon wrote: > Hi lily, > You can get fairly good starting values just by eyeballing the curves: > > plot(y) > lines(supsmu(1:20,y)) >

Re: [R] fitting cosine curve

2017-06-20 Thread Jim Lemon
Hi lily, You can get fairly good starting values just by eyeballing the curves: plot(y) lines(supsmu(1:20,y)) lines(0.6*cos((1:20)/3+0.6*pi)+17.2) Jim On Wed, Jun 21, 2017 at 9:17 AM, lily li wrote: > Hi R users, > > I have a question about fitting a cosine curve. I don't know how to set the >

[R] fitting cosine curve

2017-06-20 Thread lily li
Hi R users, I have a question about fitting a cosine curve. I don't know how to set the approximate starting values. Besides, does the method work for sine curve as well? Thanks. Part of the dataset is in the following: y=c(16.82, 16.72, 16.63, 16.47, 16.84, 16.25, 16.15, 16.83, 17.41, 17.67, 17.

[R] Fitting arima Models with Exogenous Variables

2017-01-20 Thread Paul Bernal
Dear friends, I have 5 exogenous variables which I´d like to incorporate into my auto.arima model. I was able to incorporate the xreg, and I understand that newxreg should be the forecast of my exogenous variables, but I have not been able to get it to work. Newxreg should only have one column?

Re: [R] Fitting Hastie's principal surfaces in R

2017-01-03 Thread Hall, Mark
Did you search for the princurve package? Sounds like it may be what you want. See https://cran.r-project.org/web/packages/princurve/index.html Best, MEH Mark E. Hall, PhD Assistant Field Manager Black Rock Field Office Winnemucca District Office 775-623-1529. On Sun, Jan 1, 2017 at 2:56 AM, Ne

Re: [R] Fitting Hastie's principal surfaces in R

2017-01-01 Thread David Winsemius
> On Jan 1, 2017, at 12:26 PM, Bert Gunter wrote: > > I couldn't find anything, but you might try searching on "thin plate > splines" on rseek.org. I realize these are different than principal > surfaces, but they might nevertheless be useful to you. Or not. > > Cheers, > Bert > > > Bert Gu

Re: [R] Fitting Hastie's principal surfaces in R

2017-01-01 Thread Bert Gunter
I couldn't find anything, but you might try searching on "thin plate splines" on rseek.org. I realize these are different than principal surfaces, but they might nevertheless be useful to you. Or not. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming al

[R] Fitting Hastie's principal surfaces in R

2017-01-01 Thread Neverstop .
Hello, I need to summarize a three-dimensional dataset through a principal surface that passes through the middle of the data. Principal surfaces are non-linear generalization of the plane created by the first two principal components and provide a non-linear summary of p-dimensional dataset. P

Re: [R] Fitting data using Generalized Pareto Distribution

2016-11-27 Thread Rui Barradas
Hello, Why quantile(train, 0.9) ? If you use quantile(train) it seems to fit the data much better. You haven't posted a data example so I've made up one. library(eva) # needed for rgpd() library(extRemes) set.seed(1) train <- rgpd(1e3, scale = 0.9, shape = -0.4) thresh90 <- quantile(train)

Re: [R] Fitting data using Generalized Pareto Distribution

2016-11-27 Thread TicoR
Let the train be the data set consisting of numbers that I need to fit. Code is as follows: library(extRemes) thresh90 <- quantile(train, 0.90) model<-fevd(train,threshold =thresh90,type="GP") Model returns the following : Negative Log-Likelihood Value: 317.7561 Estimated parameters: scal

Re: [R] Fitting data using Generalized Pareto Distribution

2016-11-27 Thread Rui Barradas
Hello, Please provide us with a reproducible example. A data exampla would be nice and some working code, the code you are using to fit the data. Rui Barradas Em 27-11-2016 15:04, TicoR escreveu: I am trying to fit some data using Generalized Pareto Distribution in R using extRemes package(h

[R] Fitting data using Generalized Pareto Distribution

2016-11-27 Thread TicoR
I am trying to fit some data using Generalized Pareto Distribution in R using extRemes package(https://cran.r-project.org/web/packages/extRemes) I am able to get the parameters for the distribution. How would I get the simulated values for the model using the parameters? [[alternative HTML

Re: [R] Fitting Mixture distributions

2016-09-13 Thread Aanchal Sharma
Yes, I mentioned it wrong , I increased the value. This did not help either. what helped is removing some samples which had zero (close to zero) values. So its working fine for this error. But there is another problem. For one of the genes it says throws following error: iteration = 1 log-lik di

Re: [R] Fitting Mixture distributions

2016-09-12 Thread Bert Gunter
Do you mean "increase the convergence value." Decreasing it should make it harder to converge (I believe, depending on exactly how "convergence vaue" is defined, so doublecheck.) -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into i

Re: [R] Fitting Mixture distributions

2016-09-12 Thread Aanchal Sharma
Thanks for the reply. I have another related issue with Gamma mixture model. here is the description: I am trying to fit a 2 component gamma mixture model to my data (residual values obtained after running Generalized Linear Model), using following command (part of the code): expr_mix_gamma <-

Re: [R] Fitting Mixture distributions

2016-09-08 Thread Martin Maechler
> Bert Gunter > on Wed, 7 Sep 2016 23:47:40 -0700 writes: > "please suggest what can I do to resolve this > issue." > Fitting normal mixtures can be difficult, and sometime the > optimization algorithm (EM) will get stuck with very slow convergence. > Presumably t

Re: [R] Fitting Mixture distributions

2016-09-08 Thread Bert Gunter
"please suggest what can I do to resolve this issue." Fitting normal mixtures can be difficult, and sometime the optimization algorithm (EM) will get stuck with very slow convergence. Presumably there are options in the package to either increase the max number of steps before giving up or make th

Re: [R] Fitting Mixture distributions

2016-09-07 Thread Aanchal Sharma
Hi Simon I am facing same problem as described above. i am trying to fit gaussian mixture model to my data using normalmixEM. I am running a Rscript which has this function running as part of it for about 17000 datasets (in loop). The script runs fine for some datasets, but it terminates when i

Re: [R] Fitting quantile (or cdf?) function to data with specified percentiles

2016-05-29 Thread David Winsemius
> On May 26, 2016, at 7:51 PM, Franco Danilo Roca Landaveri > wrote: > > Hello, > > I hope you can help me. In class, we were given an Excel worksheet with > specified formulas that take the total score from a survey (or from a > specific section) and convert it to a percentage, according to

Re: [R] Fitting quantile (or cdf?) function to data with specified percentiles

2016-05-27 Thread Vito Michele Rosario Muggeo
A possible (simple) solution is to use a binomial GLM which guarantees fitted values (percentiles) in (0,1): plot(percentile, score) o<-glm(percentile~sc, family=binomial) points(fitted(o), sc, col=2) You can "predict" percentiles given score via predict.glm() best, vito Franco Danilo Roca L

[R] Fitting quantile (or cdf?) function to data with specified percentiles

2016-05-27 Thread Franco Danilo Roca Landaveri
Hello, I hope you can help me. In class, we were given an Excel worksheet with specified formulas that take the total score from a survey (or from a specific section) and convert it to a percentage, according to a table that assigns scores to a percentile. Since the formulas are too long and co

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-14 Thread Aditya Bhatia
Thank you for the amazing response. You are right;I definitely have to study a bit more. I am just trying to copy the procedure in a paper so I didn't give it much thought. for point (a) : yes the data is binned counts; and my aim is to find out which curve best approximates these counts. I am go

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-14 Thread Therneau, Terry M., Ph.D.
On 10/14/2015 05:00 AM, r-help-requ...@r-project.org wrote: I am trying to fit this data to a weibull distribution: My y variable is:1 1 1 4 7 20 7 14 19 15 18 3 4 1 3 1 1 1 1 1 1 1 1 1 and x variable is:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-14 Thread peter dalgaard
There's a number of issues with this: (a) your data appear to be binned counts, not measurements along a curve. (b) The function you are trying to fit is the Weibull _density_ This has integral 1, by definition, whereas any curve anywhere near your y's would have integral near sum(y)=127 (c) SSw

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-13 Thread Aditya Bhatia
Yes. I do.I'm trying to repeat the methodology of a paper. They have fitted their data to a weibull curve and so I want to do the same too, but I'm unable to figure out how.. On Wed, Oct 14, 2015, 9:44 AM David Winsemius wrote: > > On Oct 13, 2015, at 2:42 PM, Aditya Bhatia wrote: > > > I am try

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-13 Thread David Winsemius
On Oct 13, 2015, at 2:42 PM, Aditya Bhatia wrote: > I am trying to fit this data to a weibull distribution: > > My y variable is:1 1 1 4 7 20 7 14 19 15 18 3 4 1 3 1 1 1 > 1 1 1 1 1 1 > > and x variable is:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 > 19 20 21 22 23 24

[R] Fitting a curve to weibull distribution in R using nls

2015-10-13 Thread Aditya Bhatia
I am trying to fit this data to a weibull distribution: My y variable is:1 1 1 4 7 20 7 14 19 15 18 3 4 1 3 1 1 1 1 1 1 1 1 1 and x variable is:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 The plot looks like this:http://i.stack.imgur.com/FrIKo.png and

Re: [R] Fitting a line on trellis plot

2015-03-26 Thread Frederic Ntirenganya
Thanks for the help. Frederic Ntirenganya Maseno University, African Maths Initiative, Kenya. Mobile:(+254)718492836 Email: fr...@aims.ac.za https://sites.google.com/a/aims.ac.za/fredo/ On Wed, Mar 25, 2015 at 4:48 PM, S Ellison wrote: > > > Call: > > lm(formula = curr_data[[tmin_col]] ~ curr_d

Re: [R] Fitting a line on trellis plot

2015-03-25 Thread S Ellison
> Call: > lm(formula = curr_data[[tmin_col]] ~ curr_data[[year_col]] - > 1 | curr_data[[month_col]]) First, this is not a sensible formula for lm; lm() does not use '|' to denote grouping. It would be a valid formula for xyplot, in which | specifies grouping variables. In lm(), '|' is sim

Re: [R] Fitting a line on trellis plot

2015-03-25 Thread Michael Dewey
On 25/03/2015 12:30, Frederic Ntirenganya wrote: Hi all, I am doing analysis which involves fitting a line on trellis plot. But the commands below (or at least the output from them) are not plotting commands. The factor is month. As you know a year has 12 months and I expect to get 12 l

[R] Fitting a line on trellis plot

2015-03-25 Thread Frederic Ntirenganya
Hi all, I am doing analysis which involves fitting a line on trellis plot. The factor is month. As you know a year has 12 months and I expect to get 12 lines one for each month. I am getting the following results which is different to my expectation. Am I have to do anything about the data? Any su

[R] Fitting fevd fuction to list R

2015-03-09 Thread Zilefac Elvis
I have data for 90 climate stations. For each station, I have made 100+ simulations using a statistical model. So, in R, I have 90 dataframes, each dataframe has 100+ simulations arranged column-wise. Now, I would like to fit an extreme value distribution (EVD) to each climate station. That is

Re: [R] Fitting Legend to Matrix Plot

2015-03-05 Thread Rich Shepard
On Thu, 5 Mar 2015, Michael Friendly wrote: Why not make the legend fit on one line above or below the plot matrix? ?legend -- look at ncol=, horiz= and xpd= args Michael, That's just the pointer I was hoping to see. There's no reason not to have the legend outside the plot matrix and now I

Re: [R] Fitting Legend to Matrix Plot

2015-03-05 Thread Michael Friendly
Why not make the legend fit on one line above or below the plot matrix? ?legend -- look at ncol=, horiz= and xpd= args On 3/4/2015 4:39 PM, Rich Shepard wrote: I have a matrix plot of ternary diagrams (pdf attached) generated with these commands: opar <- par(xpd=NA,no.readonly=T) plot(Wint

[R] Fitting Legend to Matrix Plot

2015-03-04 Thread Rich Shepard
I have a matrix plot of ternary diagrams (pdf attached) generated with these commands: opar <- par(xpd=NA,no.readonly=T) plot(WintersY, pch=as.numeric(WintersX4), col=c("black","red","green","blue","yellow","orange")[WintersX4]) legend(x=0.75, y=0.0, abbreviate(levels(WintersX4),

Re: [R] Fitting gamma distribution

2015-02-16 Thread Rolf Turner
On 17/02/15 12:59, smart hendsome wrote: I'm very new to r-programming. I have rainfall data. I have tried to fit gamma into my data but there is error. Anyone can help me please. My rainfall data as I uploaded. When I try run the coding: library(MASS) KLT1<-read.csv('C:/Users/User/Dropbox/PhD

[R] Fitting gamma distribution

2015-02-16 Thread smart hendsome
I'm very new to r-programming. I have rainfall data. I have tried to fit gamma into my data but there is error. Anyone can help me please. My rainfall data as I uploaded. When I try run the coding: library(MASS) KLT1<-read.csv('C:/Users/User/Dropbox/PhD Materials/Coding_PhD_Thesis/Kelantan_Avera

[R] Fitting distributions in uneven parameters

2015-01-06 Thread Maria Lathouri
Hi All, First of all, I would like to wish you all a Happy New Year, full of creativity, inspiration and prosperity. Now, I have a data set with two uneven size parameters  which is the following:     x1    x2 1  0.98    0.952  0.99    0.98 3  1.11    1.01 4

Re: [R] Fitting a Tweedie distribution

2015-01-02 Thread David Winsemius
On Jan 2, 2015, at 12:04 PM, Ben Bolker wrote: > Ben Bolker gmail.com> writes: > >> >> Paul Hudson gmail.com> writes: >> > > [snip] > >> library("tweedie") >> set.seed(1001) >> r <- rtweedie(1000,1.5,mu=2,phi=2) >> library("bbmle") >> dtweedie2 <- function(x,power,mu,phi,log=FALSE,debug=FA

Re: [R] Fitting a Tweedie distribution

2015-01-02 Thread Ben Bolker
Ben Bolker gmail.com> writes: > > Paul Hudson gmail.com> writes: > [snip] > library("tweedie") > set.seed(1001) > r <- rtweedie(1000,1.5,mu=2,phi=2) > library("bbmle") > dtweedie2 <- function(x,power,mu,phi,log=FALSE,debug=FALSE) { > if (debug) cat(power,mu,phi,"\n") > res <- dtweed

Re: [R] Fitting a Tweedie distribution

2015-01-02 Thread Ben Bolker
Paul Hudson gmail.com> writes: > > Hello all, > > I want to fit a tweedie distribution to the data I have. > > The R packages I have been able to find assume that I want to use it as > part as of a generalized linear model. > > This is not the case, I want to directly fit the distribution to

Re: [R] Fitting a Tweedie distribution

2015-01-02 Thread David Winsemius
On Jan 2, 2015, at 10:33 AM, Paul Hudson wrote: > Hello all, > > I want to fit a tweedie distribution to the data I have. > > The R packages I have been able to find assume that I want to use it as > part as of a generalized linear model. > > This is not the case, I want to directly fit the di

Re: [R] Fitting a Tweedie distribution

2015-01-02 Thread Hasan Diwan
The tweedle package[1] claims to have "functions for computing and fitting the Tweedie family of distributions". Hope that helped. -- H 1. http://cran.r-project.org/web/packages/tweedie On 2 January 2015 at 10:33, Paul Hudson wrote: > Hello all, > > I want to fit a tweedie distribution to the da

[R] Fitting a Tweedie distribution

2015-01-02 Thread Paul Hudson
Hello all, I want to fit a tweedie distribution to the data I have. The R packages I have been able to find assume that I want to use it as part as of a generalized linear model. This is not the case, I want to directly fit the distribution to the data. Is there a package that allows this?

Re: [R] Fitting Structural Equation Model with sem package and Summary issues

2014-12-19 Thread John Fox
Dear Guillaume, Please see comments interspersed below: > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of > Guillaume Souchay > Sent: Thursday, December 18, 2014 8:50 AM > To: r-help@r-project.org > Subject: [R] Fitting Structural E

[R] Fitting Structural Equation Model with sem package and Summary issues

2014-12-18 Thread Guillaume Souchay
Hi all, I am trying to analyse bird data to investigate carry-over effect using structural equation model. I failed to run properly a big model with several latent variables with both L -> M block and M -> L block. Rather than trying again and again with the huge model, I am now looking to a subse

[R] fitting distribution

2014-09-29 Thread eliza botto
Dear UseRs, I have a dataset in the following form. > dput(Da) structure(c(0.0238095238095238, 0.0476190476190476, 0.0714285714285714, 0.0952380952380952, 0.119047619047619, 0.142857142857143, 0.167, 0.19047619047619, 0.214285714285714, 0.238095238095238, 0.261904761904762, 0.285714

Re: [R] fitting grid-based models

2014-06-17 Thread Javier Rodríguez Pérez
Hi Thomas, Thank you very much for your help. I will try to calculate some summary statistics and fit observed and simulated data using a time series (as your examples). With observed data, I would use two values (e.g. 0 and 10), because I do not have intermediate values. Thanks! Javier 2014-06-1

Re: [R] fitting grid-based models

2014-06-17 Thread Thomas Petzoldt
On 17.06.2014 10:37, Javier Rodríguez Pérez wrote: Hi Thomas, Thank you very much for your help. I will try to calculate some summary statistics and fit observed and simulated data using a time series (as your examples). With observed data, I would use two values (e.g. 0 and 10), because I do not

[R] fitting grid-based models

2014-06-17 Thread Javier Rodríguez Pérez
Hello! I'm trying to generate grid-based landscape mimicking observed data. For this purpose I'm using simecol and adapting the "CA" (stochastic celular automaton) model included as example in vignette. I think this example could be nice given observed data has spatial autocorrelation. My observed

Re: [R] fitting grid-based models

2014-06-17 Thread Thomas Petzoldt
Hi, I have no example at hand, but the usual way could be indeed to calculate a time series of an adequate statistic (e.g. spatial statistic) from both, the observed and the simulated data and then to apply standard model fitting. Thomas __ R-help@r-p

[R] Fitting multiple nonlinear regression lines with nlrob()

2014-05-20 Thread jlabo...@huskers.unl.edu
Greetings R community, I would like to regress a nonlinear trend onto several subsets of data (representing different treatments) within a dataset. In my case, I would like to fit a nonlinear trend to several different "Tillage" treatments. model.global = nlrob(FinalBiomass ~ Wm[Tillage]*(1

Re: [R] Fitting a Mixture of Noncentral Student t Distributions to a one-dimensional sample

2014-05-08 Thread Ingmar Visser
Hi Johannes, Below code gives good results for me; note that trying multiple starting is often important in fitting mixture models, even in simple cases like this. Note also that the sigma and nu parameters in gamlssMX are fitted on a log scale, hence the possible occurrence of negative results. ht

[R] Fitting a Mixture of Noncentral Student t Distributions to a one-dimensional sample

2014-04-30 Thread Johannes Moser
Dear R community, I`d like to extract the parameters of a two-component mixture distribution of noncentral student t distributions which was fitted to a one-dimensional sample. There are many packages for R that are capable of handling mixture distributions in one way or another. Some in the

Re: [R] fitting a family of curves

2014-04-23 Thread Greg Snow
Can you provide some sample data and the family of curves that you would like to fit? Reproducible examples greatly increase your chances of receiving a useful response. On Wed, Apr 23, 2014 at 12:33 AM, andreas betz wrote: > Hello, > > is it possible to fit a group of curves simultaneously to a

[R] fitting a family of curves

2014-04-23 Thread andreas betz
Hello, is it possible to fit a group of curves simultaneously to an equation with some parameters shared among the curves others fit for each curve individually. Several commercial software programs like Originlab have this option often referred to as global fit. I would appreciate any advice or r

[R] fitting

2014-03-19 Thread IZHAK shabsogh
given the data below x1<-c(-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1) y<-c(-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1) z<-c(-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1) using maple i can fit as below and get (1) #PolynomialFit(3, x1,

[R] fitting a bivariate model using the copula package

2014-03-11 Thread Charles Thuo
require(copula) # I specify the copula gmb<-gumbelCopula(4,dim=2) # The bivariate CDF is generated myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.69,sdlog=0.7781),list(mu=16,size=2.6))) # A random sample of the bivariate risk data is generated as a matrix. Th

[R] fitting the lognormal and binomial into a gumbel copula

2014-03-08 Thread Charles Thuo
require(copula) # I specify the copula gmb<-gumbelCopula(4,dim=2) # The bivariate CDF is generated myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.69,sdlog=0.7781),list(mu=16,size=2.6))) # A random sample of the bivariate risk data is generated as a matrix. Th

[R] fitting the lognormal and negative binomial into a gumble copula

2014-03-06 Thread Charles Thuo
# I define a bivariate copula composed of 2 marginals each with 2 parameters gmb<-gumbelCopula(4,dim=2) # Idefine the bivariate CDF specifying the already fitted parameters from the log normal and negative binomial myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.6

[R] Fitting two parameter observations into copulas

2014-03-05 Thread Yang Yang
Hi, I have one set of observations containing two parameters. How to fit it into copula (estimate the parameter of the copula and the margin function)? Let's say the margin distribution are log-normal distributions, and the copula is Gumbel copula. The data is as below: 1 974.0304 1010 2 60

Re: [R] Fitting glm with maxit=0?

2014-02-26 Thread Xiaogang Su
Thanks David for stopping by this thread. I have to admit that the word "arbitrary" was arbitrarily chosen. As I explained in the second email in the thread, what I am really interested are some estimates obtained via other methods that have the same asymptotic distribution as MLE. The following si

Re: [R] Fitting glm with maxit=0?

2014-02-26 Thread David Winsemius
On Feb 26, 2014, at 12:24 AM, Xiaogang Su wrote: > Dear All, > > Does anyone know if there is any way to obtain the variance-covariance > matrix for any arbitrarily given estimates with the glm() function? > > Here is what I really want. Given an arbitrary estimate (i.e., as starting > points w

[R] Fitting glm with maxit=0?

2014-02-26 Thread Xiaogang Su
Dear All, Does anyone know if there is any way to obtain the variance-covariance matrix for any arbitrarily given estimates with the glm() function? Here is what I really want. Given an arbitrary estimate (i.e., as starting points with the start= argument), the glm() function could return the cor

Re: [R] fitting a time series into a GARCH model using fGarch

2014-02-25 Thread Kehl Dániel
next time! HTH daniel Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; meghatalmazó: Charles Thuo [tcmui...@gmail.com] Küldve: 2014. február 25. 8:36 To: r-help@r-project.org Tárgy: [R] fitting a time series into a GARCH model using

[R] fitting a time series into a GARCH model using fGarch

2014-02-24 Thread Charles Thuo
I have been trying to fit a time series object using the garchFit() function. However am getting the results below > class(v.ts) [1] "ts" fit=garchFit(v.ts) Error in if (allVarsTest != 1) { : missing value where TRUE/FALSE needed I do not understand the error. Which missing value is required. K

Re: [R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
On 2/10/2014 11:12 AM, Bert Gunter wrote: Perhaps: ?tapply and/or various wrappers like ?by . Cheers, Bert Thanks, Bert The examples for ?by gave the answer I was looking for: # using by() mods <- with(Punishment, by(Punishment, list(age, education), function(x)

Re: [R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Bert Gunter
Perhaps: ?tapply and/or various wrappers like ?by . Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." H. Gilbert Welch On Mon, Feb 10, 2014 at 8:05 AM, Michael Friendly

[R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
With data like the following, a frequency table in data frame form, I'd like to fit a collection of loglm models of independence of ~ attitude + memory for each combination of education and age. I can use apply() if I first convert the data to a 2 x 2 x 3 x 3 array, but I can't figure out an e

Re: [R] Fitting particle size analysis data

2013-12-22 Thread PIKAL Petr
ned solution. Petr From: Zorig Davaanyam [mailto:dzo...@gmail.com] Sent: Saturday, December 21, 2013 12:36 AM To: PIKAL Petr Subject: Re: [R] Fitting particle size analysis data Hi, Thanks for the reply. Do you know how to find the fitted parameters of lognormal distribution? Regards, Zorig On Fri,

Re: [R] Fitting particle size analysis data

2013-12-20 Thread PIKAL Petr
t.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Zorig Davaanyam > Sent: Friday, December 20, 2013 2:01 AM > To: r-help@r-project.org > Subject: [R] Fitting particle size analysis data > > Hi all, > > How do you fit a sieve analysis data to a statistical func

  1   2   3   4   5   6   >