753 questions
1
vote
1
answer
121
views
Why does my logistic curve_fit prediction return huge values although R² ≈ 0.99?
I’m trying to fit a logistic function to GDP data (China GDP dataset) using scipy.optimize.curve_fit.
The fitting looks very good (R² ≈ 0.99, curve matches the data), but when I try to predict a ...
2
votes
0
answers
98
views
Find necessary operators for symbolic regression
I wrote a symbolic regression tool in Python. It is possible to give unary and binary operators. If nothing is specified, I want to determine potential operators. So, I want to know if there is an ...
0
votes
1
answer
65
views
Smoothening of data in excel based on certain rules
I have following example data
The Figures depend on 3 parameters: X, Y & Rank. Out of these we are making 4 buckets. High X High Y, Low X Low Y, High X, Low Y and Low X, High Y. Then we are ...
0
votes
1
answer
69
views
crosspred from DLNM in R isn't accepting elements from a list?
I feel like I'm missing something really obvious here. I'm using the R package DLNM to fit a model. It's happening inside a function (not shown) so that I can feed in different datasets and change the ...
0
votes
1
answer
97
views
Comparing nls() to nls2() - what am I doing wrong
I am trying to emulate an nls() fit with nls2() via brute-force, when nls() works, so that I can look to a second option when it doesn't.
What am I doing wrong in how I have specified nls2() below? Is ...
0
votes
1
answer
104
views
Correct calculation of r square (R^2) using visual basic WorksheetFunction.LinEst function
I have written visual basic code to determine the r square when fitting data using different order polynomials:
Linear
2nd order polynomial
3rd order polynomial
As an example, I have used the ...
2
votes
1
answer
145
views
Maximum number of function evaluations has been exceeded - increase MaxFunEvals option
I was trying to fit a data set into a sinusoidal function with the code below:
data = importdata('analisipicco.txt') ;
x = data(:,1) ; y = data(:,2) ;
yu = max(y);
yl = min(y);
yr = (yu-yl); ...
-1
votes
1
answer
63
views
How can we calculate mean absolute error (MAE) for zero-inflated Poisson regression and zero-inflated negative binomial regression?
I am trying to use Python to calculate mean absolute error (MAE) while doing zero-inflated Poisson regression and zero-inflated negative binomial regression.
I separated data into training data and ...
0
votes
1
answer
145
views
Adding a covariate to an asymptotic regression model in R with nlme and SSasympOrig
I have two groups of data and reason to believe that they follow the same asymptotic curve with offset upper limits. All the observations are assumed to be independent. I fit a simple model with the ...
0
votes
1
answer
133
views
Why do I get negative values for parameters in a curve fitting?
I'm trying to fit modeling data as a curve using Scipy's optimize curve_fit to some scattered data, but I got a negative value of (bX) parameter that makes no sense. So I'm not sure what is wrong with ...
0
votes
1
answer
57
views
What does assign(home=1) mean in Pandas Python?
I am trying to understand what the following snippet of the code does, in particular the assign(home=1).rename part:
goal_model_data = pd.concat([epl[['HomeTeam','AwayTeam','HomeGoals']].assign(home=1)...
0
votes
0
answers
76
views
I'm training a model of machine learning polynomial regression using pytorch, and im getting errors while trying to plot the results of my predictions
I want to plot my data into a plt.scatter form but when I try to fill it, it just says that the x and y are not of the same size, and I also squeezed them to only one dimension so that it is easier to ...
0
votes
0
answers
90
views
Polynomial Regression with Non-Linear Constraints on R
I am not an expert with non-linear regression, but I struggle to make it work.
I would like to fit the polynomial f(x) = ax^3 + bx^2 + cx + d, with the following constraints on my parameters :
I want ...
1
vote
0
answers
111
views
Bootstrapped confidence intervals for non-linear mixed effects model
I'm trying to get bootstrapped confidence intervals for parameter estimates of a non-linear (Gompertz) mixed effects model built in the lme4 package with function nlmer(). I need to be able to graph ...
0
votes
1
answer
108
views
out of bounds error using nardl function in narld package
I run the example included in the documentation of the nardl function in the nardl package
############################################
# Fit the nonlinear cointegrating autoregressive distributed lag ...
0
votes
0
answers
42
views
Plot of confidence limits changes when I change the axis ticks and labels for a polynomial regression
A multiple regression with number of days from start of observations gives me a plot in which the confidence limits are shown for the entire range of x-values of the curve. When I change the ticks and ...
1
vote
1
answer
136
views
Item-count technique/List experiment
I would like to conduct multivariate regressions analyses of survey data with the item count technique using ictreg but without success as I keep seeing the following error message "Error in ...
0
votes
1
answer
367
views
half-normal plot for a nonlinear model using the nls() function
I fitted a non-linear model to a dataset.
However, I need to perform the half-normal plot of this model (using the hnp() function from the hnp package).
My model was fitted considering the nls() ...
1
vote
0
answers
775
views
Testing proportional odds assumption in R for ordinal logistic regression on ordinal variable with many categories
I'm trying to run an ordinal logistic regression to predict an ordinal variable with 8 categories (bins of # of days spent recreating) based on a categorical (BIPOC/not) and continuous (urbanicity ...
0
votes
0
answers
58
views
set up the initial guess values for curve_fit based on I/O
I am new in optimization and would like to write code that will determine the values of a1, a2, b1, b2 for a predefined function f_model based on the available inputs X1_data X2_data and output Y_list....
0
votes
0
answers
52
views
Problem fitting an nls function with a decreasing trend
For context, I have calculated 3 functional diversity indices from the potentially non-affected fraction (PNAF) of species at different dissolved oxygen concentrations. In order to fit a regression I ...
0
votes
0
answers
40
views
MATLAB: Why is this code not running? I tried to make a surface fit and all variables are defined
%use fitobject = fit([x,y],z,fitType)creates a surface fit to the data in vectors x, y, and z.
fitobject = fit([t,omega_0],z,fitType);
fittype('A*cos(omega_0*t+phi)','problem',{'A','phi'},'options',fo)...
0
votes
1
answer
116
views
curve fitting of a non-linear model in shiny
I'm trying to fit some non-linear models in shiny to identify the best parameter values and then use them as initial values. As an example, I'm using a non-linear logistic model.
Below is the ...
1
vote
1
answer
894
views
Error in NLME function: Singularity in backsolve at level 0, block 1
I'm trying to fit ELISA plate data to a non-linear mixed effect model, using the nlme function. Previously, I asked about how to make the syntax work for nested groups, though responses made it seem ...
1
vote
1
answer
70
views
mean in Bayesian formula for non-linear modeling with brms
I am trying to fit non-linear models with brms. My model is:
y = intercept + b1 * (x1 * mean(x2^b2))
where:
x1 is a measured continuous variable,
x2 is also a continuous variable nested in x1. For ...