I have trouble completing a loop in which I set a parameter K (which can take "any" value), define a long series of functions, and have to make the output equal to the initial K until the iteration converges. how could I do this? I would like to give a simplified example as below.
gen K=0
forvalues i=0(0.0001)100 {
replace K=`i'
gen s=K^8/100-5+K^2
}
How can I adjust this code so that it eventually gives me which value of K makes s (the output of the entire code) equal to K? Thanks so much for any feedback! Really stuck here ....
gen K=0
forvalues i=0(0.0001)100 {
replace K=`i'
gen s=K^8/100-5+K^2
}
How can I adjust this code so that it eventually gives me which value of K makes s (the output of the entire code) equal to K? Thanks so much for any feedback! Really stuck here ....
Comment