Questions tagged [model-fitting]

Fitting parameters of a function to explain given data

414 questions
4
votes
1 answer

Detecting outliers in zero inflated and overdispersed count data

I want to thank you in advance for your consideration of my problem. I have what I naively thought to be a fairly straight forward problem that involves outlier detection for many different sets of count data. Specifically, I want to determine if…
4
votes
3 answers

How to estimate the best fitting function to a scatter plot in R?

I have scatterplot of two variables, for instance this: x<-c(0.108,0.111,0.113,0.116,0.118,0.121,0.123,0.126,0.128,0.131,0.133,0.136) y<-c(-6.908,-6.620,-5.681,-5.165,-4.690,-4.646,-3.979,-3.755,-3.564,-3.558,-3.272,-3.073) and I would like to…
user18441
  • 643
  • 1
  • 7
  • 15
3
votes
2 answers

Fitting a sigmoidal curve to points with ggplot

I have a simple dataframe for the response measurements from a drug treatment at various doses: drug <- c("drug_1", "drug_1", "drug_1", "drug_1", "drug_1", "drug_1", "drug_1", "drug_1", "drug_2", "drug_2", "drug_2", "drug_2", "drug_2",…
FriendlyFred
  • 43
  • 1
  • 5
3
votes
0 answers

Fitting a bivariate or multivariate weibull distribution to observations in R

I'm looking to fit a bivariate Weibull distribution to my observations. I'm considering writing this myself but before starting I just want to check if anyone has come across a r-package including this functionality or similar. I'm considering using…
Johannes M
  • 31
  • 4
3
votes
2 answers

Overfitting the Lasso regression model to the data

I wanted to create a model that would describe the behaviour of my data. I tried the simple linear regression, simple polynomial regression and polynomial regression with regularization and cross-validation. I found that the last method allows an…
3
votes
1 answer

Why aren't any points showing up in the qqcomp function when using plotstyle="ggplot"?

I want to compare the fit of different distributions to my data in a single plot. The qqcomp function from the fitdistrplus package pretty much does exactly what I want to do. The only problem I have however, is that it's mostly written using base R…
Denzo
  • 240
  • 1
  • 7
3
votes
1 answer

How to fit 2-D function if some of the data points are NaNs?

I am trying to fit a 2-D surface to a data. More specifically, I want to find a function which maps pixel coordinate to wavelength coordinate, just as FITCOORDS in IRAF does. As an example, I want to find the fit to test array in the following…
ysBach
  • 353
  • 3
  • 14
3
votes
1 answer

Local minimum at initial point when fitting gaussian with `lsqcurvefit`

I am writing MATLAB code with the intention to do some fittings. I simulated a plot using a second-order Gaussian (see my code below) and tried fitting using the lsqcurvefit function. Unfortunately, MATLAB returns the same guess values as…
3
votes
1 answer

Advantage of fit_generator() in keras

I was wondering if the fit_generator() in keras has any advantage in respect to memory usage over using the usual fit() method with the same batch_size as the generator yields. I've seen some examples similar to this: def generator(): (X_train,…
3
votes
1 answer

Wrong Fit using nls function

When I try to fit an exponential decay and my x axis has decimal number, the fit is never correct. Here's my data below: exp.decay = data.frame(time,counts) time counts 1 0.4 4458 2 0.6 2446 3 0.8 1327 4 1.0 814 5 1.2 549 6 …
3
votes
1 answer

how do I fit a grid of points on a random point cloud

I have a binary image with dots, which I obtained using OpenCV's goodFeaturesToTrack, as shown on Image1. Image1 : Cloud of points I would like to fit a grid of 4*25 dots on it, such as the on shown on Image2 (Not all points are visible on the…
3
votes
1 answer

Fitting WCS coordinate solution using identified stars with astropy

I've got a stationary all-sky camera and would like to fit the WCS solution (map pixels x,y to alt,az). If I identify a few stars, I can get an initial solution thusly import numpy as np from astropy.modeling import models, fitting from…
I.P. Freeley
  • 885
  • 1
  • 9
  • 19
3
votes
1 answer

To do a spline surface fit using scipy's RectBivariateSpline and SmoothBivariateSpline on noisy data

I am trying to do a 2D-surface fit on some imaging data. I attached an example of such data, which is basically a 1014 x 1014 array with substantial amount of noise. Example_image. Some patches of this array are invalid data, which I masked and set…
3
votes
1 answer

Error in `freeParam` in fitting of normal copula [R]

I am using R version 3.3.2 and the package copula version 0.999-15 to evaluate the fitting of the normal copula to my data. My data and code are: Data: https://www.dropbox.com/s/tdg8bfzmy4nd1dd/jumps.dat?dl=0 library(copula) data <-…
Pierre
3
votes
1 answer

Fitting ODE in R, with the use of the FME package

I'm trying to fit an ODE model to some data and solve for the values of the parameters in the model. I know there is a package called FME in R which is designed to solve this kind of problem. However, when I tried to write the code like the manual…
Ken.w
  • 31
  • 3
1 2
3
27 28