SlideShare a Scribd company logo
1 of 15
Non linear regression analysis: 
In statistics , nonlinear regression is a form of regression 
analysis in which observational data are modeled by a 
function which is a nonlinear combination of the model 
parameters are depends on one or more independent 
variables . The method of least square is used for 
estimating the parameters. Minimizing this equation 
푆푆퐷 훽 = Σ 푦 − 푓 푥; 훽 
2 
We estimate 훽.
R code for nonlinear curve fitting 
To perform the nonlinear regression analysis in R then 
we use nls function. 
Example: 
t<-seq (0,10,0.1) 
y<-rnorm(101,5* exp (-t/5),0.2) 
plot(t, y, type="p", pch =16,col="red")
Plot : 
From the diagram we see that the function is not linear.
Now we perform the nonlinear analysis 
nls(y~A*exp (-alpha*t),start=c(A=2,alpha=0.05)) 
summary(nls(y~A*exp(alpha*t),start=c(A=2,alpha=0.05))) 
#Using summary we can test the hypothesis whether the 
parameters are zero or not. 
Outcome: 
A alpha 
5.0664 0.2025 
residual sum-of-squares: 4.436 
Number of iterations to convergence: 5
Estimate Std. Error t value Pr(>|t|) 
A 5.066399 0.062600 80.93 <2e-16 *** 
alpha 0.202503 0.004034 50.20 <2e-16 *** 
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
Residual standard error: 0.2117 on 99 degrees of freedom 
From the result we see that the p value too small(<0.05) 
. so we reject the null hypothesis.
Gompertz function…. 
Gompertz curve or Gompertz function is a type of 
mathematical model for a time series. In the Gompartz 
curve growth is slowest at the start and end of a time 
period. The Gompertz curve has a sigmoidal shape. The 
equation is 
푦 = 푎푒−푏푒−푔푥
Gompertz curve:
Fitting Gompertz Curve: 
Finding the starting value: 
library(ISwR) 
juul 
attach(subset(juul2,age<20 & age>5 & sex==1)) 
data.1<-subset(juul2,age<20 & age>5 & sex==1) 
attach(data.1) 
Now the Gompertz model is a푒−푏푒−푔푥 
,the curve has a sigmoidal 
shape , approaching a constant level a as x increases and zero for 
large negative x. To obtain b and g parameter determined the 
location and sharpness. To obtain starting values for a non-linear 
fit one approach is to notice that the relation between y and x is 
something like log-log linear 
log(log(α)-log(y))=log(b)-gx
From the figure (juul2), we get the maximum value of height i.e. a=200. With 
this guess 
we can make a plot that should so an approximate linear relationship. 
plot(log(log(200)-log(height))~age, col="blue", pch=16) 
fit<-lm(log(log(200)-log(height))~age) 
fit 
From this we get the value of 
log(b)=0.42 and age=-0.1553 
Now we fit a nonlinear regression analysis 
nls(height~ α * exp (b * exp (-g*age)),start=c(α =200,b= exp (0.4293),g =0.1553)) 
plot( age, height) 
fit<-nls( height~ α*exp(- b *exp(- g *age)),start=c(a=200, b=exp(0.4293),g =0.1553)) 
Summary(fit) 
fit.frame<-seq ( 5,20,0.001) 
lines(fit.frame, predict(fit, newdata =data.frame(age=fit.frame)),lwd=2)
Outcomes: 
After fitting the nls function we get the values of 
a b g 
242.80628 1.17598 0.07903 
then we test the hypothesis that the parameters are zero or not. 
Parameters: 
Estimate Std. Error t value P(>|t|) 
a 2.428e+02 1.157e+01 20.978 <2e-16 *** 
b 1.176e+00 1.892e-02 62.149 <2e-16 *** 
g 7.903e-02 8.569e-03 9.222 <2e-16 *** 
--- 
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
From the result we see that the p values of parameters are too 
small(<0.05). so we reject our null hypothesis at 5% level of 
significant.
Plot the function with respect the sequence.
Self starting models: 
Doesn't need to input initial values. 
This type of functions are starting with SS in R 
Ssgompertz. 
library(ISwR) 
age.height<-subset(juul2,age<20 & age>5 & sex==1) 
attach(age.height) 
nls(height~ SSgompertz(age,α,b, g )) 
α b g 
242.807 1.176 0.924 
residual sum-of-squares: 23151
Draw back of self starting method: 
One minor drawback of self starting models is that we can 
not just transform them if you want to see if the model fits 
better on, e.g. a log-transformation 
nls(log(height)~log(SSgompertz(age,α,b,g))) 
So we can not use any transformation in self starting model.
Thank you……

More Related Content

What's hot

multiple regression
multiple regressionmultiple regression
multiple regressionPriya Sharma
 
Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)YesAnalytics
 
Numerical integration
Numerical integrationNumerical integration
Numerical integrationSunny Chauhan
 
Regression analysis.
Regression analysis.Regression analysis.
Regression analysis.sonia gupta
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regressioncbt1213
 
Correlation and Regression
Correlation and RegressionCorrelation and Regression
Correlation and RegressionShubham Mehta
 
Non Linear Equation
Non Linear EquationNon Linear Equation
Non Linear EquationMdAlAmin187
 
Probability Distributions
Probability DistributionsProbability Distributions
Probability DistributionsCIToolkit
 
Linear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec domsLinear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec domsBabasab Patil
 
Correlation and regression analysis
Correlation and regression analysisCorrelation and regression analysis
Correlation and regression analysis_pem
 
regression and correlation
regression and correlationregression and correlation
regression and correlationPriya Sharma
 
Probability distribution
Probability distributionProbability distribution
Probability distributionRohit kumar
 
Complements and Conditional Probability, and Bayes' Theorem
 Complements and Conditional Probability, and Bayes' Theorem Complements and Conditional Probability, and Bayes' Theorem
Complements and Conditional Probability, and Bayes' TheoremLong Beach City College
 

What's hot (20)

multiple regression
multiple regressionmultiple regression
multiple regression
 
Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Regression analysis.
Regression analysis.Regression analysis.
Regression analysis.
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regression
 
Correlation and Regression
Correlation and RegressionCorrelation and Regression
Correlation and Regression
 
Correlation
CorrelationCorrelation
Correlation
 
Non Linear Equation
Non Linear EquationNon Linear Equation
Non Linear Equation
 
Probability Distributions
Probability DistributionsProbability Distributions
Probability Distributions
 
Linear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec domsLinear regression and correlation analysis ppt @ bec doms
Linear regression and correlation analysis ppt @ bec doms
 
Probability concept and Probability distribution
Probability concept and Probability distributionProbability concept and Probability distribution
Probability concept and Probability distribution
 
Correlation and regression analysis
Correlation and regression analysisCorrelation and regression analysis
Correlation and regression analysis
 
regression and correlation
regression and correlationregression and correlation
regression and correlation
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Poisson Probability Distributions
Poisson Probability DistributionsPoisson Probability Distributions
Poisson Probability Distributions
 
Curve fitting
Curve fittingCurve fitting
Curve fitting
 
Complements and Conditional Probability, and Bayes' Theorem
 Complements and Conditional Probability, and Bayes' Theorem Complements and Conditional Probability, and Bayes' Theorem
Complements and Conditional Probability, and Bayes' Theorem
 
Taylor series in 1 and 2 variable
Taylor series in 1 and 2 variableTaylor series in 1 and 2 variable
Taylor series in 1 and 2 variable
 
Regression
RegressionRegression
Regression
 

Viewers also liked

Viewers also liked (8)

Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Es272 ch5a
Es272 ch5aEs272 ch5a
Es272 ch5a
 
case study of curve fitting
case study of curve fittingcase study of curve fitting
case study of curve fitting
 
Curve fitting - Lecture Notes
Curve fitting - Lecture NotesCurve fitting - Lecture Notes
Curve fitting - Lecture Notes
 
phd thesis presentation
phd thesis presentationphd thesis presentation
phd thesis presentation
 
Mathematical modeling
Mathematical modelingMathematical modeling
Mathematical modeling
 
Chapter 14 Part I
Chapter 14 Part IChapter 14 Part I
Chapter 14 Part I
 
metode numerik kurva fitting dan regresi
metode numerik kurva fitting dan regresimetode numerik kurva fitting dan regresi
metode numerik kurva fitting dan regresi
 

Similar to Non linear curve fitting

CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudsko
CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudskoCHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudsko
CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudskoSydneyJaydeanKhanyil
 
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAAhmed Gamal Abdel Gawad
 
BALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxBALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxOthmanBensaoud
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksStratio
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyJorgeVillamarin5
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notationsajinis3
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptx
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptxModelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptx
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptxKadiriIbrahim2
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1luisescobedo38
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexityAbbas Ali
 
Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05Charlton Inao
 
Gauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodGauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodMeet Nayak
 

Similar to Non linear curve fitting (20)

CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudsko
CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudskoCHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudsko
CHAPTER 7.pdfdjdjdjdjdjdjdjsjsjddhhdudsko
 
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
 
Lec_2.pdf
Lec_2.pdfLec_2.pdf
Lec_2.pdf
 
BALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxBALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptx
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural Networks
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
CRYPTO 2.pptx
CRYPTO 2.pptxCRYPTO 2.pptx
CRYPTO 2.pptx
 
lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
 
algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Regression
RegressionRegression
Regression
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptx
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptxModelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptx
Modelling using differnt metods in matlab2 (2) (2) (2) (4) (1) (1).pptx
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05
 
Gauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodGauss jordan and Guass elimination method
Gauss jordan and Guass elimination method
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
 
Mqm em
Mqm emMqm em
Mqm em
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
 

Recently uploaded

Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxAArockiyaNisha
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 sciencefloriejanemacaya1
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxAleenaTreesaSaji
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzohaibmir069
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdf
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdfNAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdf
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdfWadeK3
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...jana861314
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSarthak Sekhar Mondal
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PPRINCE C P
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Lokesh Kothari
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxpradhanghanshyam7136
 

Recently uploaded (20)

Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 science
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptx
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistan
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdf
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdfNAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdf
NAVSEA PEO USC - Unmanned & Small Combatants 26Oct23.pdf
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C P
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptx
 

Non linear curve fitting

  • 1. Non linear regression analysis: In statistics , nonlinear regression is a form of regression analysis in which observational data are modeled by a function which is a nonlinear combination of the model parameters are depends on one or more independent variables . The method of least square is used for estimating the parameters. Minimizing this equation 푆푆퐷 훽 = Σ 푦 − 푓 푥; 훽 2 We estimate 훽.
  • 2. R code for nonlinear curve fitting To perform the nonlinear regression analysis in R then we use nls function. Example: t<-seq (0,10,0.1) y<-rnorm(101,5* exp (-t/5),0.2) plot(t, y, type="p", pch =16,col="red")
  • 3. Plot : From the diagram we see that the function is not linear.
  • 4. Now we perform the nonlinear analysis nls(y~A*exp (-alpha*t),start=c(A=2,alpha=0.05)) summary(nls(y~A*exp(alpha*t),start=c(A=2,alpha=0.05))) #Using summary we can test the hypothesis whether the parameters are zero or not. Outcome: A alpha 5.0664 0.2025 residual sum-of-squares: 4.436 Number of iterations to convergence: 5
  • 5. Estimate Std. Error t value Pr(>|t|) A 5.066399 0.062600 80.93 <2e-16 *** alpha 0.202503 0.004034 50.20 <2e-16 *** Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.2117 on 99 degrees of freedom From the result we see that the p value too small(<0.05) . so we reject the null hypothesis.
  • 6. Gompertz function…. Gompertz curve or Gompertz function is a type of mathematical model for a time series. In the Gompartz curve growth is slowest at the start and end of a time period. The Gompertz curve has a sigmoidal shape. The equation is 푦 = 푎푒−푏푒−푔푥
  • 8. Fitting Gompertz Curve: Finding the starting value: library(ISwR) juul attach(subset(juul2,age<20 & age>5 & sex==1)) data.1<-subset(juul2,age<20 & age>5 & sex==1) attach(data.1) Now the Gompertz model is a푒−푏푒−푔푥 ,the curve has a sigmoidal shape , approaching a constant level a as x increases and zero for large negative x. To obtain b and g parameter determined the location and sharpness. To obtain starting values for a non-linear fit one approach is to notice that the relation between y and x is something like log-log linear log(log(α)-log(y))=log(b)-gx
  • 9. From the figure (juul2), we get the maximum value of height i.e. a=200. With this guess we can make a plot that should so an approximate linear relationship. plot(log(log(200)-log(height))~age, col="blue", pch=16) fit<-lm(log(log(200)-log(height))~age) fit From this we get the value of log(b)=0.42 and age=-0.1553 Now we fit a nonlinear regression analysis nls(height~ α * exp (b * exp (-g*age)),start=c(α =200,b= exp (0.4293),g =0.1553)) plot( age, height) fit<-nls( height~ α*exp(- b *exp(- g *age)),start=c(a=200, b=exp(0.4293),g =0.1553)) Summary(fit) fit.frame<-seq ( 5,20,0.001) lines(fit.frame, predict(fit, newdata =data.frame(age=fit.frame)),lwd=2)
  • 10.
  • 11. Outcomes: After fitting the nls function we get the values of a b g 242.80628 1.17598 0.07903 then we test the hypothesis that the parameters are zero or not. Parameters: Estimate Std. Error t value P(>|t|) a 2.428e+02 1.157e+01 20.978 <2e-16 *** b 1.176e+00 1.892e-02 62.149 <2e-16 *** g 7.903e-02 8.569e-03 9.222 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 From the result we see that the p values of parameters are too small(<0.05). so we reject our null hypothesis at 5% level of significant.
  • 12. Plot the function with respect the sequence.
  • 13. Self starting models: Doesn't need to input initial values. This type of functions are starting with SS in R Ssgompertz. library(ISwR) age.height<-subset(juul2,age<20 & age>5 & sex==1) attach(age.height) nls(height~ SSgompertz(age,α,b, g )) α b g 242.807 1.176 0.924 residual sum-of-squares: 23151
  • 14. Draw back of self starting method: One minor drawback of self starting models is that we can not just transform them if you want to see if the model fits better on, e.g. a log-transformation nls(log(height)~log(SSgompertz(age,α,b,g))) So we can not use any transformation in self starting model.